Skip to content

Conversation

scottfisk
Copy link
Contributor

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.

@scottfisk scottfisk changed the title Check for legacy pagination case without relying on catching assertion Django 1.7 Tests Fix - change pagination check Sep 3, 2015
@scottfisk scottfisk changed the title Django 1.7 Tests Fix - change pagination check Django 1.7 Tests Fix - change legacy pagination check Sep 3, 2015
@scottfisk
Copy link
Contributor Author

Also I am not sure what branch to PR this to ultimately. I wanted it to run against the tox config, so I started with this branch.

@jerel jerel merged commit b4d8556 into django-json-api:feature/test-all-versions Sep 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants