Setting LimitOffsetPagination.default_limit = api_settings.PAGE_SIZE
prevents the PAGE_SIZE
setting from being overridden in tests
#8581
Unanswered
brmc
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This seems like a bug, but I wanted to bring it up in case I'm doing something wrong.
Once the class is loaded into memory, I couldn't figure out a way to change the setting during tests by using
django.test.override_settings
, usingdjango.test.modify_settings
, changingapi_settings.PAGE_SIZE
manually.rest_framework.settings.reload_api_settings
didn't help either.I finally resorted to using
with mock.patch("preondock.api.pagination.NoLimitOffsetPagination.default_limit", 1)
.Is this by design, or is there something different i should be doing?
Beta Was this translation helpful? Give feedback.
All reactions