mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Minor fixes based on comments.
This commit is contained in:
parent
b08a2d1d88
commit
ab8e37eeaa
@ -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):
|
||||
"""Return count of active, unique hosts for licensing."""
|
||||
#try:
|
||||
# return self.filter(active=True, inventory__active=True).distinct('name').count()
|
||||
#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)))
|
||||
try:
|
||||
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')
|
||||
return len(set(self.filter(active=True, inventory__active=True).values_list('name', flat=True)))
|
||||
|
||||
class InstanceManager(models.Manager):
|
||||
"""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.head(url, expect=200)
|
||||
response = self.get(url, expect=200)
|
||||
print response
|
||||
self.check_pagination_and_size(response, 1, previous=None, next=None)
|
||||
|
||||
def test_basic_fields(self):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user