Ejemplo n.º 1
0
 def setup_view(self):  # lint-amnesty, pylint: disable=missing-function-docstring
     view = SingleThreadViewFixture(Thread(id="response_edit_test_thread", commentable_id=self.discussion_id))
     view.addResponse(
         Response(id="response_other_author", user_id="other", thread_id="response_edit_test_thread"),
     )
     view.addResponse(
         Response(id="response_self_author", user_id=self.user_id, thread_id="response_edit_test_thread"),
     )
     view.push()
Ejemplo n.º 2
0
 def setup_view(self):
     view = SingleThreadViewFixture(
         Thread(id="response_edit_test_thread",
                commentable_id=self.discussion_id))
     view.addResponse(
         Response(id="response_other_author",
                  user_id="other",
                  thread_id="response_edit_test_thread"), )
     view.addResponse(
         Response(id="response_self_author",
                  user_id=self.user_id,
                  thread_id="response_edit_test_thread"), )
     view.push()
Ejemplo n.º 3
0
 def setup_view(self, **thread_kwargs):  # lint-amnesty, pylint: disable=missing-function-docstring
     thread_kwargs.update({'commentable_id': self.discussion_id})
     view = SingleThreadViewFixture(
         Thread(id=self.thread_id, **thread_kwargs)
     )
     view.addResponse(Response(id="response1"))
     view.push()
Ejemplo n.º 4
0
 def setup_thread(self, num_responses, **thread_kwargs):
     """
     Create a test thread with the given number of responses, passing all
     keyword arguments through to the Thread fixture, then invoke
     setup_thread_page.
     """
     thread_id = "test_thread_{}".format(uuid4().hex)
     thread_fixture = SingleThreadViewFixture(
         Thread(id=thread_id, commentable_id=self.discussion_id, **thread_kwargs)
     )
     for i in range(num_responses):
         thread_fixture.addResponse(Response(id=str(i), body=str(i)))
     thread_fixture.push()
     self.setup_thread_page(thread_id)
     return thread_id
Ejemplo n.º 5
0
 def setup_view(self, **thread_kwargs):
     thread_kwargs.update({'commentable_id': self.discussion_id})
     view = SingleThreadViewFixture(
         Thread(id=self.thread_id, **thread_kwargs))
     view.addResponse(Response(id="response1"))
     view.push()