Django 1.7 Tests Fix - change legacy pagination check #70
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am running Django 1.7, Python 2.7, DRF 3.2 and wanted to look at the state of the tests. The only test failure for this setup was the one modified in the PR.
I noticed that when using Django 1.7 something was fishy using a try/catch on an
AssertionError
to test the legacy DRF case of including?page=1
to the link. Switching to Django 1.8 (changing nothing else) did not have an issue with the try/except wrapping this assertion.Digging further I noticed in Django 1.7 the except raised was
exceptions.AssertionError
and in Django 1.8 the exception raised was a_pytest.assertion.reinterpret.AssertionError
. (Again, changing nothing else)At this point I gave up and rewrote the test to not rely on catching an
AssertionError
as that seemed a bit brittle anyway. Everything now passes in my setup.Unrelated... I noticed that
?page1
was actually included in all my tests (on the newest DRF). So it seems the comment may be wrong about it not being present in newer DRFs. In that case there may be another bug where?page=1
is included when it shouldn't be.