Advertisement
Guest User

Untitled

a guest
Apr 10th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. class PostDetailsViewTests(TestCase):
  2. def test_post_details(self):
  3. call_command('check_permissions')
  4.  
  5. user = create_user()
  6. user.save()
  7. active_user = UserenaSignup.objects.activate_user(user.userena_signup.activation_key)
  8.  
  9. active_user.save()
  10. post = create_post(active_user)
  11. post.save()
  12. event=create_event(active_user)
  13. event.posts.add(post)
  14. self.client.login(username=active_user.username, password="my_password", email= active_user.email)
  15. response = self.client.get(reverse('posts:details', args=(post.pk,event.pk)))
  16. self.assertEqual(response.request['PATH_INFO'], '/posts/show/1/')
  17. self.assertEqual(response.status_code, 200)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement