tests: test interface URLs
This commit is contained in:
parent
4d02bad89c
commit
cecf66e523
|
@ -1,7 +1,6 @@
|
|||
import base64
|
||||
|
||||
import pytest
|
||||
from django.core.urlresolvers import reverse
|
||||
from django.utils.http import urlencode
|
||||
from fargo.fargo import utils, models
|
||||
from test_manager import login
|
||||
|
@ -15,7 +14,7 @@ def test_create_validation(settings, app, admin_user, john_doe, jane_doe):
|
|||
'user_email': john_doe.email,
|
||||
}
|
||||
schema = utils.get_document_type_schema(settings, 'avis-d-imposition')
|
||||
url = reverse('fargo-api-validation-list', kwargs={'document_type': 'avis-d-imposition'})
|
||||
url = '/api/validation/avis-d-imposition/'
|
||||
assert models.Validation.objects.count() == 0
|
||||
response = app.post_json(url, params=data, status=400)
|
||||
assert response.json['result'] == 0
|
||||
|
@ -51,7 +50,7 @@ def test_push_document(app, admin_user, john_doe):
|
|||
data = {
|
||||
'user_email': john_doe.email,
|
||||
}
|
||||
url = reverse('fargo-api-push-document')
|
||||
url = '/api/documents/push/'
|
||||
# error checking test
|
||||
assert models.Origin.objects.count() == 0
|
||||
assert models.UserDocument.objects.count() == 0
|
||||
|
@ -110,7 +109,7 @@ def test_push_document(app, admin_user, john_doe):
|
|||
def test_push_document_max_document_size(app, private_settings, admin_user, john_doe):
|
||||
private_settings.FARGO_MAX_DOCUMENT_SIZE = 1
|
||||
login(app)
|
||||
url = reverse('fargo-api-push-document')
|
||||
url = '/api/documents/push/'
|
||||
data = {
|
||||
'user_email': john_doe.email,
|
||||
'origin': 'wcs',
|
||||
|
@ -127,7 +126,7 @@ def test_push_document_max_document_size(app, private_settings, admin_user, john
|
|||
def test_push_document_max_document_box_size(app, private_settings, admin_user, john_doe):
|
||||
private_settings.FARGO_MAX_DOCUMENT_BOX_SIZE = 4
|
||||
login(app)
|
||||
url = reverse('fargo-api-push-document')
|
||||
url = '/api/documents/push/'
|
||||
data = {
|
||||
'user_email': john_doe.email,
|
||||
'origin': 'wcs',
|
||||
|
@ -146,7 +145,7 @@ def test_push_document_max_document_box_size(app, private_settings, admin_user,
|
|||
|
||||
def test_push_document_slashed_name(app, admin_user, john_doe):
|
||||
login(app)
|
||||
url = reverse('fargo-api-push-document')
|
||||
url = '/api/documents/push/'
|
||||
data = {
|
||||
'user_email': john_doe.email,
|
||||
'origin': 'wcs',
|
||||
|
|
Loading…
Reference in New Issue