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.
Hey Imogen,
This is as far as I got with the tests. The linchpin change was line 32 of settings/base.py. Importing the migrate function explicitly allows that to work and gets rid of the annoying cursor error.
Once I got that working, I realized that we cannot just open a server separately and then change to a testing database. You have to open the server after switching to the testing database, which is why admin_browser inherits from
live_server
. There's a tiny bit of documentation on it here: http://pytest-django.readthedocs.io/en/latest/helpers.html But it's super cool and runs the django server for you.And unfortunately this also runs us into a long-standing and unsolved wagtail bug here: wagtail/wagtail#1824 If we want the DB changes to be transactional, we need to sqlflush the DB. But evidently wagtail can't do that because of a migration bug their devs don't want to fix. In the issue there someone suggested a migration fix, but I couldn't figure out how to incorporate it.
We should definitely make the
settings/base.py
change toadd-page-models
at which point we won't need_translation
on any of our commands anymore. And then maybe if we can fix thatwagtailsearch_editorspick
bug...