mirror of
https://github.com/graphql-python/graphene-django.git
synced 2024-11-10 19:57:15 +03:00
b9f0e4f9ae
* Reset the global registry after each test (teardown) * Create a settings fixtures that returns graphene_settings and resets the graphene_settings after use (teardown) * Convert test_mutation tests from unittests.TestCase to pytest * Convert test_mutation PetType to a pet_type fixtures that reregisters the type
19 lines
374 B
Python
19 lines
374 B
Python
import pytest
|
|
|
|
from graphene_django.settings import graphene_settings as gsettings
|
|
|
|
from .registry import reset_global_registry
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
def reset_registry_fixture(db):
|
|
yield None
|
|
reset_global_registry()
|
|
|
|
|
|
@pytest.fixture()
|
|
def graphene_settings():
|
|
settings = dict(gsettings.__dict__)
|
|
yield gsettings
|
|
gsettings.__dict__ = settings
|