Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Fix freezegun lifecycle
Browse files Browse the repository at this point in the history
Should use decorator instead of manually start/stop to avoid failed setUp() leaving mock in place and breaking many
other tests.
  • Loading branch information
mparent61 committed Sep 1, 2016
1 parent 9bbe20e commit 77b1f12
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/contributions/test_contributions_api.py
Expand Up @@ -952,11 +952,10 @@ def test_rolefield_rate_interpretation(self):
contribution.delete()


@freeze_time('2015-09-25')
class ReportingApiTestCase(BaseAPITestCase):
def setUp(self):
super(ReportingApiTestCase, self).setUp()
self.freezer = freeze_time("2015-09-25")
self.freezer.start()
now = timezone.now()
self.roles = {
"FlatRate": ContributorRole.objects.create(name='Author', payment_type=0),
Expand Down Expand Up @@ -1144,7 +1143,6 @@ def setUp(self):
Contribution.search_objects.refresh()

def tearDown(self):
self.freezer.stop()
super(ReportingApiTestCase, self).tearDown()

def test_exclude_content_without_contributions(self):
Expand Down

0 comments on commit 77b1f12

Please sign in to comment.