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))
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))
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))
def test_failed_results(self): upload = FileUpload.objects.create() process_results(upload.pk, self.data) self.check_status('failure', description=mock.ANY)
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))