mirror of
https://github.com/ansible/awx.git
synced 2026-03-01 00:38:45 -03:30
Minor fixes based on comments.
This commit is contained in:
@@ -1,4 +0,0 @@
|
|||||||
# Copyright (c) 2016 Ansible, Inc.
|
|
||||||
# All Rights Reserved.
|
|
||||||
|
|
||||||
from awx.api.tests import * # noqa
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
# Copyright (c) 2016 Ansible, Inc.
|
|
||||||
# All Rights Reserved.
|
|
||||||
|
|
||||||
from awx.fact.tests import * # noqa
|
|
||||||
@@ -12,11 +12,10 @@ class HostManager(models.Manager):
|
|||||||
|
|
||||||
def active_count(self):
|
def active_count(self):
|
||||||
"""Return count of active, unique hosts for licensing."""
|
"""Return count of active, unique hosts for licensing."""
|
||||||
#try:
|
try:
|
||||||
# return self.filter(active=True, inventory__active=True).distinct('name').count()
|
return self.filter(active=True, inventory__active=True).order_by('name').distinct('name').count()
|
||||||
#except NotImplementedError: # For unit tests only, SQLite doesn't support distinct('name')
|
except NotImplementedError: # For unit tests only, SQLite doesn't support distinct('name')
|
||||||
# FIXME-CC
|
return len(set(self.filter(active=True, inventory__active=True).values_list('name', flat=True)))
|
||||||
return len(set(self.filter(active=True, inventory__active=True).values_list('name', flat=True)))
|
|
||||||
|
|
||||||
class InstanceManager(models.Manager):
|
class InstanceManager(models.Manager):
|
||||||
"""A custom manager class for the Instance model.
|
"""A custom manager class for the Instance model.
|
||||||
|
|||||||
@@ -1,4 +0,0 @@
|
|||||||
# Copyright (c) 2015 Ansible, Inc.
|
|
||||||
# All Rights Reserved.
|
|
||||||
|
|
||||||
from awx.main.tests import * # noqa
|
|
||||||
@@ -31,7 +31,6 @@ class ActivityStreamTest(BaseTest):
|
|||||||
self.options(url, expect=200)
|
self.options(url, expect=200)
|
||||||
self.head(url, expect=200)
|
self.head(url, expect=200)
|
||||||
response = self.get(url, expect=200)
|
response = self.get(url, expect=200)
|
||||||
print response
|
|
||||||
self.check_pagination_and_size(response, 1, previous=None, next=None)
|
self.check_pagination_and_size(response, 1, previous=None, next=None)
|
||||||
|
|
||||||
def test_basic_fields(self):
|
def test_basic_fields(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user