def test_last_viewed(self): test_post = PostFactory(last_accessed=(timezone.now() - datetime.timedelta(days=1))) last = test_post.last_accessed test_post.last_viewed() now = test_post.last_accessed self.assertGreater(now, last)