def setUp(self): self.me = users_factories.ProfileFactory() self.client.force_authenticate(user=self.me.user) self.other = users_factories.ProfileFactory() self.thread = ThreadFactory(profile_1=self.me, profile_2=self.other) self.message1 = MessageFactory(thread=self.thread, sender=self.me) self.message2 = MessageFactory(thread=self.thread, sender=self.other) self.message1_json = MessageSerializer(message1).data self.message2_json = MessageSerializer(message2).data
def setUp(self): self.profile = factories.ProfileFactory() self.client.force_authenticate(user=self.profile.user) self.blog = blogfactory.BlogFactory() self.comment = blogfactory.CommentFactory() self.comment.blog = self.blog self.comment2 = blogfactory.CommentFactory() self.comment3 = blogfactory.CommentFactory() self.comment4 = blogfactory.CommentFactory() self.comment5 = blogfactory.CommentFactory() self.comment6 = blogfactory.CommentFactory() self.comment7 = blogfactory.CommentFactory() self.comment8 = blogfactory.CommentFactory() self.comment6.blog = self.blog self.comment7.blog = self.blog self.comment8.blog = self.blog self.comment3.comment = self.comment self.comment4.comment = self.comment3 self.comment5.comment = self.comment3 self.comment2.comment = self.comment3 self.comment.save() self.comment2.save() self.comment3.save() self.comment4.save() self.comment5.save() self.comment6.save() self.comment7.save() self.comment8.save() self.blog.save()
def setUp(self): self.profile = factories.ProfileFactory() self.client.force_authenticate(user=self.profile.user) self.blog = blogfactory.BlogFactory() self.comment = blogfactory.CommentFactory() self.comment.user = self.profile.user self.comment.save() self.blog.save()
def setUp(self): self.profile = factories.ProfileFactory() self.client.force_authenticate(user=self.profile.user) self.blog = blogfactory.BlogFactory() self.blog1 = blogfactory.BlogFactory() self.blog2 = blogfactory.BlogFactory() self.blog2.publish = False self.blog2.save() self.blog.title = 'TestQueryTitle' self.blog.save()
def setUp(self): self.me = users_factories.ProfileFactory() self.client.force_authenticate(user=self.me.user) self.thread1 = ThreadFactory(profile_1=self.me) self.thread2 = ThreadFactory(profile_1=self.me) self.message = MessageFactory(thread=self.thread1) self.message1 = MessageFactory(thread=self.thread2) self.message2 = MessageFactory(thread=self.thread2) self.message3 = MessageFactory(thread=self.thread2)
def test_thread_not_exists(self): self.other2 = users_factories.ProfileFactory() create_url = reverse('messaging:check_history', kwargs={'profile_id': self.other2.id}) resp = self.client.get(create_url, ) self.assertFalse(resp.data['exists']) self.other2.user.delete()
def test_create_invalid_user_blog(self): profile2 = factories.ProfileFactory() create_url = reverse('blog:createview', kwargs={'username': profile2.get_username()}) blog_params = { 'title': 'test title', 'body': 'test body', 'anonymous': False } resp = self.client.post( create_url, data=blog_params, ) self.assertFalse( BlogPost.objects.filter( user__username__iexact=self.profile.user.username).exists())
def setUp(self): self.profile = users_factories.ProfileFactory() self.mentor = users_factories.MentorFactory(profile=self.profile) self.client.force_authenticate(user=self.profile.user)
def setUp(self): self.profile = factories.ProfileFactory() self.client.force_authenticate(user=self.profile.user)
def setUp(self): self.profile = factories.ProfileFactory() self.client.force_authenticate(user=self.profile.user) self.blog = blogfactory.BlogFactory() self.ablog = blogfactory.AnonymousBlogFactory()
def setUp(self): self.me = users_factories.ProfileFactory() self.client.force_authenticate(user=self.me.user) self.other1 = users_factories.ProfileFactory() self.other2 = users_factories.ProfileFactory()
def setUp(self): self.me = users_factories.ProfileFactory() self.client.force_authenticate(user=self.me.user) self.other = users_factories.ProfileFactory() self.thread = ThreadFactory(profile_1=self.me, profile_2=self.other)