Skip to content

Commit

Permalink
Added cleaning up thread local to tearDown()
Browse files Browse the repository at this point in the history
  • Loading branch information
macro1 committed Sep 10, 2014
1 parent 0b7379d commit 341aec1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions simple_history/tests/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from django.contrib.auth.models import User
from django.contrib.admin.util import quote
from django.conf import settings
from simple_history.models import HistoricalRecords

from ..models import Book, Person, Poll, State

Expand Down Expand Up @@ -40,6 +41,12 @@ def setUp(self):
self.user = User.objects.create_superuser('user_login',
'[email protected]', 'pass')

def tearDown(self):
try:
del HistoricalRecords.thread.request
except AttributeError:
pass

def login(self, user=None):
if user is None:
user = self.user
Expand Down

0 comments on commit 341aec1

Please sign in to comment.