comparison news/tests/test_views.py @ 1206:02181fa5ac9d modernize tip

Update to Django 1.9.
author Brian Neal <bgneal@gmail.com>
date Wed, 22 Jan 2025 17:58:16 -0600
parents e2c3d7ecfa30
children
comparison
equal deleted inserted replaced
1205:510ef3cbf3e6 1206:02181fa5ac9d
42 } 42 }
43 now = datetime.datetime.now() 43 now = datetime.datetime.now()
44 response = self.client.post(self.view_url, args, follow=True) 44 response = self.client.post(self.view_url, args, follow=True)
45 self.assertEqual(response.status_code, 200) 45 self.assertEqual(response.status_code, 200)
46 self.assertEqual(response.redirect_chain, 46 self.assertEqual(response.redirect_chain,
47 [('http://testserver' + reverse('news-submit_thanks'), 302)]) 47 [(reverse('news-submit_thanks'), 302)])
48 48
49 stories = list(PendingStory.objects.all()) 49 stories = list(PendingStory.objects.all())
50 self.assertEqual(len(stories), 1) 50 self.assertEqual(len(stories), 1)
51 story = stories[0] 51 story = stories[0]
52 self.assertEqual(story.submitter, self.user) 52 self.assertEqual(story.submitter, self.user)