Skip to content

Commit

Permalink
Update test suite to use pytest-django with conftest.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
FlipperPA committed Mar 5, 2023
1 parent c57d080 commit 1418c94
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
7 changes: 1 addition & 6 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_page(db):
title="TEST Wagtail Code Block Page",
slug="wagtail-code-block",
content_type=page_content_type,
path="00010001",
path="00010002",
depth=2,
numchild=0,
url_path="/wagtail-code-block/",
Expand All @@ -51,9 +51,4 @@ def test_page(db):
}]),
)

# Create default site
site, created = Site.objects.get_or_create(
hostname="localhost", root_page_id=test_page.id, is_default_site=True
)

return test_page
4 changes: 0 additions & 4 deletions tests/test_blocks.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
from json import dumps

import pytest

from tests.models import CodeBlockPage


@pytest.mark.django_db
def test_create_page(test_page):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ ignore = E203, W503
max-line-length = 88

[pytest]
addopts = --tb=short --reuse-db --nomigrations
addopts = --tb=short --create-db --no-migrations
DJANGO_SETTINGS_MODULE = tests.settings
norecursedirs = .git .vscode tmp templates static_dev static assets docs node_modules htmlcov

0 comments on commit 1418c94

Please sign in to comment.