Skip to content

Commit

Permalink
[tests] Refactored flaky test test_devicegroup_list_api openwisp#679
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy authored Aug 17, 2022
1 parent 0e63597 commit 0bf687c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions openwisp_controller/config/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,12 @@ def test_devicegroup_list_api(self):
t1 = self._create_template(name='t1')
t2 = self._create_template(name='t2', required=True)
r = self.client.get(path, {'format': 'api'})
self.assertContains(r, t1.name)
self.assertNotContains(r, t2.name)
self.assertContains(
r, f'<option value="{t1.id}">{t1.name}</option>', html=True
)
self.assertNotContains(
r, f'<option value="{t2.id}">{t2.name}</option>', html=True
)

def test_devicegroup_detail_api(self):
device_group = self._create_device_group()
Expand Down

0 comments on commit 0bf687c

Please sign in to comment.