Example #1
0
    def test_detail_rater_return_new_rating(self):
        test_user = User.objects.create_user('test', '*****@*****.**', 'pass')
        test_user.save()
        time = timezone.now()
        rating = Rating(rater=1, movie=3, rating=5, timestamp=time)
        rating.save()

        response = self.client.get(reverse('detail_rater', args=[rater.id]))
        self.assertContains(response, 'Testing')
Example #2
0
    def test_was_recently_published_future_rating(self):
        time = timezone.now() + datetime.timedelta(days=10)
        rating = Rating(rater=2, movie=44, rating=5, timestamp=time)

        self.assertFalse(rating.was_published_recently(), "Rating not recent")