Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ dev = [
"coverage",
"django-guardian",
"graphviz",
"mypy",
"pre-commit",
"pytest",
"pytest-cov",
"pytest-django",
"pytest-randomly",
"tox",
]

Expand Down
8 changes: 8 additions & 0 deletions tests/testapp/tests/test_basic_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ def setUp(self):
pre_transition.connect(self.on_pre_transition, sender=SimpleBlogPost)
post_transition.connect(self.on_post_transition, sender=SimpleBlogPost)

def tearDown(self):
pre_transition.disconnect(self.on_pre_transition, sender=SimpleBlogPost)
post_transition.disconnect(self.on_post_transition, sender=SimpleBlogPost)

def on_pre_transition(self, sender, instance, name, source, target, **kwargs):
assert instance.state == source
self.pre_transition_called = True
Expand Down Expand Up @@ -166,6 +170,10 @@ def setUp(self):
pre_transition.connect(self.on_pre_transition, sender="testapp.SimpleBlogPost")
post_transition.connect(self.on_post_transition, sender="testapp.SimpleBlogPost")

def tearDown(self):
pre_transition.disconnect(self.on_pre_transition, sender="testapp.SimpleBlogPost")
post_transition.disconnect(self.on_post_transition, sender="testapp.SimpleBlogPost")


class TestFieldTransitionsInspect(TestCase):
def setUp(self):
Expand Down
3 changes: 3 additions & 0 deletions tests/testapp/tests/test_exception_transitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ def setUp(self):
post_transition.connect(self.on_post_transition, sender=ExceptionalBlogPost)
self.post_transition_data = {}

def tearDown(self):
post_transition.disconnect(self.on_post_transition, sender=ExceptionalBlogPost)

def on_post_transition(self, **kwargs):
self.post_transition_data = kwargs

Expand Down
4 changes: 4 additions & 0 deletions tests/testapp/tests/test_multi_resultstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ def setUp(self):
pre_transition.connect(self.on_pre_transition, sender=MultiResultTest)
post_transition.connect(self.on_post_transition, sender=MultiResultTest)

def tearDown(self):
pre_transition.disconnect(self.on_pre_transition, sender=MultiResultTest)
post_transition.disconnect(self.on_post_transition, sender=MultiResultTest)

def on_pre_transition(self, sender, instance, name, source, target, **kwargs):
assert instance.state == source
self.pre_transition_called = True
Expand Down
Loading