style tweaks, add one more assertion

This commit is contained in:
AlanCoding
2016-03-13 22:39:52 -04:00
parent 39c9563352
commit 6996ea22b0
2 changed files with 3 additions and 4 deletions

View File

@@ -641,8 +641,8 @@ class OrganizationList(ListCreateAPIView):
# the case of deleted (and purged) inventory
db_JT_results = self.request.user.get_queryset(JobTemplate)\
.filter(inventory_id__in=inv_qs.values_list('pk', flat=True))\
.values(JT_reference).annotate(Count(JT_reference)).\
order_by(JT_reference)
.values(JT_reference).annotate(Count(JT_reference))\
.order_by(JT_reference)
# Produce counts of m2m relationships
project_qs = self.request.user.get_queryset(Project)

View File

@@ -63,6 +63,7 @@ def test_new_org_zero_counts(user, post):
new_org_list = post_response.render().data
counts_dict = new_org_list['summary_fields']['counts']
assert post_response.status_code == 201
assert counts_dict == {
'users': 0,
'admins': 0,
@@ -80,8 +81,6 @@ def test_two_organizations(resourced_organization, organizations, user, get):
response = get(reverse('api:organization_list', args=[]), external_admin)
org_id_full = resourced_organization.id
org_id_zero = organization_zero.id
print ' ids: ' + str(org_id_full) + " : " + str(org_id_zero)
print ' counts_dict: ' + str(response.data['results'])
counts = {}
for i in range(2):
org_id = response.data['results'][i]['id']