tests: detect use of --nomigrations through pytestconfig
Module pytest_django.migrations was removed in pytest_django 4.2.0.
This commit is contained in:
parent
d8ce463306
commit
cfb8a0619f
|
@ -27,7 +27,6 @@ from django.core.cache import cache
|
|||
from django.core.management import call_command
|
||||
from django.db import connection
|
||||
from django.db.migrations.executor import MigrationExecutor
|
||||
from pytest_django.migrations import DisableMigrations
|
||||
|
||||
from authentic2 import hooks as a2_hooks
|
||||
from authentic2.a2_rbac.utils import get_default_ou
|
||||
|
@ -283,14 +282,6 @@ def concurrency(settings):
|
|||
return 100
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def migrations():
|
||||
from django.conf import settings
|
||||
|
||||
if isinstance(settings.MIGRATION_MODULES, DisableMigrations):
|
||||
pytest.skip('this test requires native migrations')
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def oidc_client(db, ou1):
|
||||
client = OIDCClient.objects.create(
|
||||
|
|
|
@ -23,7 +23,9 @@ from authentic2.models import Attribute, AttributeValue
|
|||
|
||||
|
||||
@pytest.mark.slow
|
||||
def test_attribute_value_uniqueness(migrations, transactional_db, simple_user, concurrency):
|
||||
def test_attribute_value_uniqueness(transactional_db, simple_user, concurrency, pytestconfig):
|
||||
if pytestconfig.getoption('nomigrations'):
|
||||
pytest.skip('running migrations is required for this test')
|
||||
# disable default attributes
|
||||
Attribute.objects.update(disabled=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue