Skip to content

Commit

Permalink
Revert test behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
bctiemann committed Dec 11, 2024
1 parent 5dd93c0 commit 5087a11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions netbox/utilities/tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def test_default_page_size(self):
self.assertIsNone(response.data['previous'])
self.assertEqual(len(response.data['results']), page_size)

@override_settings(MAX_PAGE_SIZE=30)
@override_settings(MAX_PAGE_SIZE=20)
def test_default_page_size_with_small_max_page_size(self):
response = self.client.get(self.url, format='json', **self.header)
page_size = get_config().MAX_PAGE_SIZE
Expand All @@ -166,15 +166,15 @@ def test_custom_page_size(self):
self.assertIsNone(response.data['previous'])
self.assertEqual(len(response.data['results']), 10)

@override_settings(MAX_PAGE_SIZE=80)
@override_settings(MAX_PAGE_SIZE=20)
def test_max_page_size(self):
response = self.client.get(f'{self.url}?limit=0', format='json', **self.header)

self.assertHttpStatus(response, status.HTTP_200_OK)
self.assertEqual(response.data['count'], 100)
self.assertTrue(response.data['next'].endswith('?limit=80&offset=80'))
self.assertTrue(response.data['next'].endswith('?limit=20&offset=20'))
self.assertIsNone(response.data['previous'])
self.assertEqual(len(response.data['results']), 80)
self.assertEqual(len(response.data['results']), 20)

@override_settings(MAX_PAGE_SIZE=0)
def test_max_page_size_disabled(self):
Expand Down

0 comments on commit 5087a11

Please sign in to comment.