new keyword api test working

This commit is contained in:
vabene1111
2021-03-10 20:31:00 +01:00
parent b9b7a125f0
commit 528f329ebb
5 changed files with 125 additions and 64 deletions

View File

@@ -1,4 +1,5 @@
import copy
import inspect
import uuid
import pytest
@@ -8,6 +9,17 @@ from django_scopes import scopes_disabled
from cookbook.models import Space
# hack from https://github.com/raphaelm/django-scopes to disable scopes for all fixtures
# does not work on yield fixtures as only one yield can be used per fixture (i think)
@pytest.hookimpl(hookwrapper=True)
def pytest_fixture_setup(fixturedef, request):
if inspect.isgeneratorfunction(fixturedef.func):
yield
else:
with scopes_disabled():
yield
@pytest.fixture(autouse=True)
def enable_db_access_for_all_tests(db):
pass