예제 #1
0
 def test_good_results(self):
     upload = FileUpload.objects.create(validation=json.dumps({
         'success': True,
         'errors': 0
     }))
     process_results(upload.pk, self.data)
     self.check_status('success', target_url=self.get_url(upload.uuid))
예제 #2
0
 def test_error_results(self):
     upload = FileUpload.objects.create(validation=json.dumps({
         'errors':
         1,
         'messages': [{
             'description': ['foo'],
             'file': 'some/file',
             'line': 3,
             'type': 'error'
         }]
     }))
     process_results(upload.pk, self.data)
     error = self.requests.post.call_args_list[0]
     self.check_status('error',
                       call=error,
                       description=mock.ANY,
                       target_url=self.get_url(upload.uuid))
예제 #3
0
 def test_error_results(self):
     upload = FileUpload.objects.create(
         validation=json.dumps({
             'errors': 1,
             'messages': [{
                 'description': ['foo'],
                 'file': 'some/file',
                 'line': 3,
                 'type': 'error'
             }]
         })
     )
     process_results(upload.pk, self.data)
     error = self.requests.post.call_args_list[0]
     self.check_status(
         'error',
         call=error, description=mock.ANY,
         target_url=self.get_url(upload.uuid))
예제 #4
0
 def test_failed_results(self):
     upload = FileUpload.objects.create()
     process_results(upload.pk, self.data)
     self.check_status('failure', description=mock.ANY)
예제 #5
0
 def test_failed_results(self):
     upload = FileUpload.objects.create()
     process_results(upload.pk, self.data)
     self.check_status('failure', description=mock.ANY)
예제 #6
0
 def test_good_results(self):
     upload = FileUpload.objects.create(
         validation=json.dumps({'success': True, 'errors': 0})
     )
     process_results(upload.pk, self.data)
     self.check_status('success', target_url=self.get_url(upload.uuid))