Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test about sub page live server #104

Merged
merged 4 commits into from
May 10, 2018

Conversation

akmiller01
Copy link
Contributor

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 to add-page-models at which point we won't need _translation on any of our commands anymore. And then maybe if we can fix that wagtailsearch_editorspick bug...

@akmiller01 akmiller01 added bug Something isn't working enhancement New feature or request incomplete PRs that are work in progress and not yet ready for review labels May 8, 2018
@allthatilk
Copy link
Contributor

@akmiller01 was wagtail/wagtail#1824 (comment) the suggested fix you mentioned?

@akmiller01
Copy link
Contributor Author

@allthatilk I was actually looking at this one wagtail/wagtail#1824 (comment) But both are options worth trying.

Changes made:

1. Mark django_db_setup override function as scope module.
2. Mark tests as ignore_template_errors to avoid having to change iati_tags.py
3. Add search migration fix to allow sqlflush, removed wagtailsearch_editorspicks table.
4. Add slug to page creation to avoid validation errors.
@akmiller01 akmiller01 added complete PRs that are complete and ready for review and removed bug Something isn't working incomplete PRs that are work in progress and not yet ready for review labels May 9, 2018
@allthatilk allthatilk merged commit 378ce10 into test-about-sub-page May 10, 2018
@allthatilk allthatilk deleted the test-about-sub-page-live-server branch May 10, 2018 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complete PRs that are complete and ready for review enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants