Moving fixture into standalone module and new module tests.utils
parent
a1c1491a84
commit
bc70ab8cc9
|
@ -1,13 +1,6 @@
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from .fixtures import *
|
||||||
class Object:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
|
||||||
def object():
|
|
||||||
return Object()
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_addoption(parser):
|
def pytest_addoption(parser):
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
|
||||||
|
class Object:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def object():
|
||||||
|
return Object()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture
|
||||||
|
def client():
|
||||||
|
from testclient_extensions import Client
|
||||||
|
|
||||||
|
return Client()
|
|
@ -1,9 +1,4 @@
|
||||||
from django.db.models import signals
|
from ..utils import disconnect_signals
|
||||||
|
|
||||||
|
|
||||||
def disconnect_signals():
|
|
||||||
signals.pre_save.receivers = []
|
|
||||||
signals.post_save.receivers = []
|
|
||||||
|
|
||||||
|
|
||||||
def pytest_runtest_setup(item):
|
def pytest_runtest_setup(item):
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
from django.db.models import signals
|
||||||
|
|
||||||
|
|
||||||
|
def disconnect_signals():
|
||||||
|
signals.pre_save.receivers = []
|
||||||
|
signals.post_save.receivers = []
|
Loading…
Reference in New Issue