Skip to content

Commit

Permalink
revert filter by service uid (#2475)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkurek committed Jun 10, 2016
1 parent f0e718b commit 3d9f38a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/ralph/data_center/api/views.py
Expand Up @@ -53,6 +53,7 @@ class DataCenterAssetViewSet(BaseObjectViewSetMixin, RalphAPIViewSet):
'connections',
'tags',
]
filter_fields = ['service_env__service__uid']
additional_filter_class = DataCenterAssetFilterSet


Expand Down
10 changes: 10 additions & 0 deletions src/ralph/data_center/tests/test_api.py
Expand Up @@ -176,6 +176,16 @@ def test_filter_by_service_uid(self):
response.data['count'], 1
)

def test_filter_by_service_uid2(self):
url = reverse('datacenterasset-list') + '?service_env__service__uid={}'.format( # noqa
self.dc_asset.service_env.service.uid,
)
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(
response.data['count'], 1
)

def test_filter_by_service_name(self):
url = reverse('datacenterasset-list') + '?service={}'.format(
self.dc_asset.service_env.service.name,
Expand Down

0 comments on commit 3d9f38a

Please sign in to comment.