Skip to content

Commit

Permalink
PEP8 style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Arulnathan committed Jan 22, 2014
1 parent bebdda0 commit 44d366b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@

try:
from django.contrib.auth import get_user_model
except ImportError: # django < 1.5
except ImportError: # django < 1.5
from django.contrib.auth.models import User
else:
User = get_user_model()


class StateLogModelTests(TestCase):
def setUp(self):
self.article = Article.objects.create(state='draft')
Expand Down Expand Up @@ -94,11 +95,10 @@ def test_get_cache_key_for_object_returns_correctly_formatted_string(self):
result = StateLog.objects._get_cache_key_for_object(self.article)
self.assertEqual(result, expected_result)


@patch('django_fsm_log.managers.cache')
def test_create_pending_sets_cache_item(self, mock_cache):
expected_cache_key = StateLog.objects._get_cache_key_for_object(self.article)
log = StateLog.objects.create_pending(**self.create_kwargs)
StateLog.objects.create_pending(**self.create_kwargs)
cache_key = mock_cache.set.call_args_list[0][0][0]
cache_object = mock_cache.set.call_args_list[0][0][1]
self.assertEqual(cache_key, expected_cache_key)
Expand All @@ -125,7 +125,7 @@ def test_commit_pending_for_object_saves_log(self):

@patch('django_fsm_log.managers.cache')
def test_commit_pending_for_object_deletes_pending_log_from_cache(self, mock_cache):
log = StateLog.objects.create_pending(**self.create_kwargs)
StateLog.objects.create_pending(**self.create_kwargs)
StateLog.objects.commit_pending_for_object(self.article)
mock_cache.delete.assert_called_once_with(StateLog.objects._get_cache_key_for_object(self.article))

Expand Down

0 comments on commit 44d366b

Please sign in to comment.