def setUp(self): self.post = Post.objects.create() self.user = create_user() self.comment = Comment.objects.create(content_object=self.post, user=self.user) self.url = reverse(self.view_name, kwargs={'pk': self.comment.pk}) self.another_user = create_user(username='******') self.client = test.APIClient() self.client.login(**self.user.credentials)
def setUp(self): self.user = create_user() self.post = Post.objects.create() self.parent = Comment.objects.create(content_object=self.post) self.url = reverse('threaded_comments_reply', args=[self.parent.pk]) self.client = test.Client() self.client.login(**self.user.credentials)
def test_delete_authenticated_no_owner(self): self.client.logout() self.client.login(**create_user(username='******').credentials) self.assertEqual(403, self.client.delete(self.url).status_code)
def setUp(self): self.user = create_user() self.post = Post.objects.create() self.req = test.RequestFactory()
def setUp(self): self.url = reverse('threaded_comments_create') self.user = create_user() self.post = Post.objects.create() self.client = test.Client() self.client.login(**self.user.credentials)