Skip to content

Commit

Permalink
Add test making sure polymorphic queryset get works correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
hipek8 committed Oct 1, 2024
1 parent 870c859 commit 72a7c1a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ralph/assets/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -963,6 +963,14 @@ def test_get_dc_hosts_list(self):
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data['count'], 63)

def test_get_dc_host_details(self):
dc_asset = DataCenterAssetFullFactory()
VirtualServerFullFactory.create_batch(2, parent=dc_asset)
CloudHostFullFactory.create_batch(2, hypervisor=dc_asset)
url = reverse('dchost-detail', args=(dc_asset.pk,))
response = self.client.get(url, format='json')
self.assertEqual(response.status_code, status.HTTP_200_OK)

def test_filter_by_type_dc_asset(self):
url = '{}?{}'.format(
reverse('dchost-list'),
Expand Down

0 comments on commit 72a7c1a

Please sign in to comment.