Beispiel #1
0
def post_response(self, status, feedback):
    request = self.factory.post(
        '/projects/' + str(self.first_task.pk) + "/", {
            'status': status,
            'feedback': feedback,
            'taskofferid': self.first_task_offer.pk,
            'offer_response': ''
        })
    request.user = self.first_user
    project_view.project_view(request, self.project.pk)
 def test_status_change(self):
     request = self.factory.post(PROJECTS_ALL, {
         'status_change': '',
         'status': self.project.status
     })
     request.user = self.first_user
     response = project_view.project_view(request, 1)
     self.assertEqual(response.status_code, 200)
Beispiel #3
0
    def test_not_existing_offer_output(self):
        status = "a"
        feedback = self.fake.sentence(nb_words=6)

        request = self.factory.post(
            '/projects/' + str(self.first_task.pk) + "/", {
                'status': status,
                'feedback': feedback,
                'taskofferid': self.fake.random_int(min=100),
                'offer_response': ''
            })
        request.user = self.first_user
        success = True
        try:
            project_view.project_view(request, self.project.pk)
        except Http404:
            success = False
        self.assertFalse(success)
 def test_offer_response(self):
     request = self.factory.post(
         PROJECTS_ALL, {
             'offer_response': '',
             'taskofferid': 1,
             'status': 'a',
             'feedback': self.fake.sentence(nb_words=10)
         })
     request.user = self.first_user
     response = project_view.project_view(request, 1)
     self.assertEqual(response.status_code, 200)
 def test_offer_submit(self):
     request = self.factory.post(
         PROJECTS_ALL, {
             'offer_submit': '',
             'title': self.fake.sentence(nb_words=3),
             'description': self.fake.sentence(nb_words=5),
             'price': self.fake.random_int(min=10, max=100000, step=10),
             'taskvalue': 1
         })
     request.user = self.second_user
     response = project_view.project_view(request, 1)
     self.assertEqual(response.status_code, 200)