we are doing immediate processing, let's return the result

This commit is contained in:
Andy McKay 2012-08-24 16:30:22 -07:00
Родитель 6273a00680
Коммит d316e5ee5b
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -52,8 +52,9 @@ class ValidationResource(MarketplaceResource):
if not form.is_valid():
raise self.form_errors(form)
bundle.obj = FileUpload.objects.create(user=amo.get_user())
tasks.fetch_manifest(form.cleaned_data['manifest'], bundle.obj.pk)
upload = FileUpload.objects.create(user=amo.get_user())
tasks.fetch_manifest(form.cleaned_data['manifest'], upload.pk)
bundle.obj = FileUpload.objects.get(pk=upload.pk)
log.info('Validation created: %s' % bundle.obj.pk)
return bundle

Просмотреть файл

@ -52,6 +52,7 @@ class TestAddValidationHandler(ValidationHandler):
res = self.create()
eq_(res.status_code, 201) # Note! This should be a 202.
content = json.loads(res.content)
eq_(content['processed'], True)
obj = FileUpload.objects.get(uuid=content['id'])
eq_(obj.user, self.user)