-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds a new `tox -e interactive` that runs a local test server, to make it easier to test this project. This is a feature that [wagtail-localize](https://www.wagtail-localize.org/#how-to-run-tests) has that we’ve also added to [wagtail-inventory](https://github.com/cfpb/wagtail-inventory#testing) and [wagtail-treemodeladmin](https://github.com/cfpb/wagtail-treemodeladmin). 🎩 to @chosak for this pattern.
- Loading branch information
1 parent
dd41c23
commit 038a6b9
Showing
3 changed files
with
43 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,3 +73,4 @@ dist/ | |
|
||
# IDEs | ||
.idea/ | ||
*.db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,22 @@ commands= | |
coverage combine | ||
coverage xml | ||
diff-cover coverage.xml --compare-branch=origin/main --fail-under=100 | ||
|
||
[testenv:interactive] | ||
basepython=python3.8 | ||
|
||
deps= | ||
Django>=3.2,<3.3 | ||
|
||
commands_pre= | ||
{envbindir}/django-admin makemigrations | ||
{envbindir}/django-admin migrate | ||
{envbindir}/django-admin shell -c "from django.contrib.auth.models import User;(not User.objects.filter(username='admin').exists()) and User.objects.create_superuser('admin', '[email protected]', 'changeme')" | ||
# {envbindir}/django-admin loaddata wagtailflags/tests/wagtailflags/fixtures/treemodeladmin_test.json | ||
|
||
commands= | ||
{posargs:{envbindir}/django-admin runserver 0.0.0.0:8000} | ||
|
||
setenv= | ||
DJANGO_SETTINGS_MODULE=wagtailflags.tests.settings | ||
INTERACTIVE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters