Beispiel #1
0
    def testMultipleResponseToSingleRequest(self):
        request = self._post(1, 1)
        response = receiver(request)
        self.assertEqual(response.status_code, 200, "First transaction should success.")
        self.assertEqual(DotResponse.objects.count(), 1)
        response = receiver(request)
        self.assertEqual(response.status_code, 200, "Second transaction should success.")
        self.assertEqual(DotResponse.objects.count(), 1, "Secent transaction should not create response.")

        global signal_count
        self.assertEqual(1, signal_count)
        signal_count = 0
Beispiel #2
0
    def testMultipleResponseToSingleRequest(self):
        request = self._post(1, 1)
        response = receiver(request)
        self.assertEqual(response.status_code, 200,
                         "First transaction should success.")
        self.assertEqual(DotResponse.objects.count(), 1)
        response = receiver(request)
        self.assertEqual(response.status_code, 200,
                         "Second transaction should success.")
        self.assertEqual(DotResponse.objects.count(), 1,
                         "Secent transaction should not create response.")

        global signal_count
        self.assertEqual(1, signal_count)
        signal_count = 0
Beispiel #3
0
 def testFakeResponses(self):
     for stat in STATUS_CHOICES:
         request = self._post(1, stat[0], True)
         response = receiver(request)
         self.assertEqual(
             response.status_code, 500,
             "CODE: " + str(response.status_code) + " Typ: " + stat[1])
Beispiel #4
0
    def testResponseswithchangedemail(self):
        for stat in STATUS_CHOICES:
            request = self._post(1, stat[0], False, True)
            response = receiver(request)
            self.assertEqual(response.status_code, 200, "CODE: " + str(response.status_code) + " Typ: " + stat[1])
        self.assertEqual(DotResponse.objects.count(), len(STATUS_CHOICES))

        global signal_count
        self.assertEqual(len(STATUS_CHOICES), signal_count)
        signal_count = 0
Beispiel #5
0
    def testResponses(self):
        for stat in DOTPAY_STATUS_CHOICES:
            request = self._post(1, stat[0])
            response = receiver(request)
            self.assertEqual(response.status_code, 200, "CODE: " + str(response.status_code) + " Type: " + stat[1])
        self.assertEqual(DotpayResponse.objects.count(), len(DOTPAY_STATUS_CHOICES))

        global signal_count
        self.assertEqual(len(DOTPAY_STATUS_CHOICES), signal_count)
        signal_count = 0
Beispiel #6
0
 def testResponses(self):
     for stat in STATUS_CHOICES:
         request = self._post(1,stat[0])
         response = receiver(request)  
         self.assertEqual(response.status_code, 200,"CODE: "+str(response.status_code)+" Typ: "+stat[1])
     self.assertEqual(len(DotResponse.objects.filter(control=self.control)),len(STATUS_CHOICES))
     
     global signal_count
     self.assertEqual(len(STATUS_CHOICES),signal_count)
     signal_count = 0
Beispiel #7
0
    def testResponseswithchangedemail(self):
        for stat in STATUS_CHOICES:
            request = self._post(1, stat[0], False, True)
            response = receiver(request)
            self.assertEqual(
                response.status_code, 200,
                "CODE: " + str(response.status_code) + " Typ: " + stat[1])
        self.assertEqual(DotResponse.objects.count(), len(STATUS_CHOICES))

        global signal_count
        self.assertEqual(len(STATUS_CHOICES), signal_count)
        signal_count = 0
Beispiel #8
0
 def testFakeResponses(self):
     for stat in STATUS_CHOICES:
         request = self._post(1, stat[0], True)
         response = receiver(request)
         self.assertEqual(response.status_code, 500, "CODE: " + str(response.status_code) + " Typ: " + stat[1])
Beispiel #9
0
 def testPostwithWrongIP(self):
     request = self._post(1, 1)
     request.META['REMOTE_ADDR'] = '127.0.0.1'
     response = receiver(request)
     self.assertEqual(response.status_code, 403, "CODE: " + str(response.status_code))
Beispiel #10
0
 def testPostwithWrongIP(self):
     request = self._post(1, 1)
     request.META['REMOTE_ADDR'] = '127.0.0.1'
     response = receiver(request)
     self.assertEqual(response.status_code, 403,
                      "CODE: " + str(response.status_code))