Exemplo n.º 1
0
 def setUp(self):
     self.thread = ThreadFactory()
     posts = UserPostFactory.create_batch(500, thread=self.thread)
     self.thread2 = ThreadFactory()
     posts2 = UserPostFactory.create_batch(350, thread=self.thread2)
     post = UserPostFactory(
         thread=self.thread
     )  #Make a post to test that bumb_order doesn't change
Exemplo n.º 2
0
 def setUp(self):
     self.thread = ThreadFactory()
     self.posts = UserPostFactory.create_batch(5, thread=self.thread)
     self.list_resp = self.client.get(reverse('api_post-list'))
     self.post = UserPostFactory(thread=self.thread)
     self.url = reverse('api_post-detail', kwargs={'post_number': self.post.post_number})
     self.detail_resp = self.client.get(self.url)
Exemplo n.º 3
0
 def setUp(self):
     mod = ModeratorFactory.create_mod()
     self.client.force_login(mod)
     self.board = BoardFactory()
     self.board2 = BoardFactory()
     self.thread = ThreadFactory(board=self.board)
     self.thread2 = ThreadFactory(board=self.board2)
     self.posts = UserPostFactory.create_batch(5,
                                               thread=self.thread,
                                               reported=True)
     self.posts2 = UserPostFactory.create_batch(5,
                                                thread=self.thread2,
                                                reported=True)
     self.resp_get_all = self.client.get(
         reverse('dj-mod:moderation_userpost_report_list'))
     self.resp_get_board = self.client.get('{}?board={}'.format(
         reverse('dj-mod:moderation_userpost_report_list'),
         self.board.slug))
Exemplo n.º 4
0
 def setUp(self):
     self.thread = ThreadFactory()
     self.posts = UserPostFactory.create_batch(5, thread=self.thread)
     self.resp = self.client.get(
         reverse('api_thread-detail',
                 kwargs={'thread_number':
                         self.thread.thread_number})).wsgi_request
     self.data = ThreadSerializer(instance=self.thread,
                                  context={
                                      'request': self.resp
                                  }).data
Exemplo n.º 5
0
 def setUp(self):
     mod = ModeratorFactory.create_mod()
     self.client.force_login(mod)
     self.board = BoardFactory()
     self.thread = ThreadFactory(board=self.board)
     self.posts = UserPostFactory.create_batch(150,
                                               reported=True,
                                               thread=self.thread)
     self.last_post = UserPostFactory(reported=True, thread=self.thread)
     self.resp = self.client.get('{}?board={}'.format(
         reverse('dj-mod:moderation_userpost_report_list'),
         self.board.slug))
     self.resp2 = self.client.get('{}?board={}&page=2'.format(
         reverse('dj-mod:moderation_userpost_report_list'),
         self.board.slug))
Exemplo n.º 6
0
 def setUp(self):
     self.thread = ThreadFactory()
     posts = UserPostFactory.create_batch(500, thread=self.thread)
Exemplo n.º 7
0
 def setUp(self):
     self.post_set1 = UserPostFactory.create_batch(5)
     self.post_set2 = UserPostFactory.create_batch(5)
     self.resp = self.client.get(reverse('navigation_frontpage'))
Exemplo n.º 8
0
 def setUp(self):
     self.thread = ThreadFactory(pinned=True)
     self.posts = UserPostFactory.create_batch(500, thread=self.thread)
     self.thread.refresh_from_db()