Skip to content

Commit

Permalink
Merge pull request #125 from incuna/remove-legacy-assert
Browse files Browse the repository at this point in the history
Remove legacy assert
  • Loading branch information
LilyFoote committed Jun 9, 2015
2 parents 039accf + f12a67c commit 5aeb823
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions user_management/api/tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,17 @@ def test_post(self):

def test_post_last_login_updates(self):
"""Authenticating updates the user's last_login."""
now = timezone.now()
user = UserFactory.create(
email=self.username,
password=self.password,
last_login=now,
)
self.assertEqual(user.last_login, now)

previous_last_login = user.last_login
now = timezone.now()
request = self.create_request('post', auth=False, data=self.data)
self.view_class.as_view()(request)
user = User.objects.get(pk=user.pk)
self.assertGreater(user.last_login, now)
self.assertNotEqual(user.last_login, previous_last_login)

def test_post_non_existing_user(self):
"""Assert non existing raises an error."""
Expand Down

0 comments on commit 5aeb823

Please sign in to comment.