Skip to content

Commit

Permalink
Add a couple of explicit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mgdaily committed Oct 9, 2024
1 parent 03e182e commit 5cc79e5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions archive/frames/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,26 @@ def setUp(self):
def test_get_frame(self):
response = self.client.get(reverse('frame-detail', args=(self.frame.id, )))
self.assertEqual(response.json()['basename'], self.frame.basename)
self.assertContains(response, 'related_frames')

def test_get_frame_exclude_related_frames(self):
response = self.client.get(reverse('frame-detail', args=(self.frame.id,)),
{'include_related_frames': False})

self.assertNotContains(response, 'related_frames')

def test_get_frame_list(self):
response = self.client.get(reverse('frame-list'))
self.assertEqual(response.json()['count'], 5)
self.assertContains(response, self.frame.basename)
self.assertContains(response, 'related_frames')

def test_get_frame_list_exclude_related_frames(self):
response = self.client.get(reverse('frame-list'),
{'include_related_frames': False})
self.assertEqual(response.json()['count'], 5)
self.assertContains(response, self.frame.basename)
self.assertNotContains(response, 'related_frames')

def test_get_frame_list_filter(self):
response = self.client.get(
Expand Down

0 comments on commit 5cc79e5

Please sign in to comment.