This commit is contained in:
Yohann D'ANELLO 2020-12-22 21:31:22 +01:00
parent 84e149e8c9
commit 969e53b712
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
1 changed files with 2 additions and 3 deletions

View File

@ -1,12 +1,11 @@
from datetime import timedelta from datetime import timedelta
import os import os
from django.core.files.uploadedfile import SimpleUploadedFile
from corres2math.tokens import email_validation_token from corres2math.tokens import email_validation_token
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.contrib.contenttypes.models import ContentType from django.contrib.contenttypes.models import ContentType
from django.contrib.sites.models import Site from django.contrib.sites.models import Site
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.management import call_command from django.core.management import call_command
from django.test import TestCase from django.test import TestCase
from django.urls import reverse from django.urls import reverse
@ -291,7 +290,7 @@ class TestRegistration(TestCase):
# Don't send too large files # Don't send too large files
response = self.client.post(reverse("registration:upload_user_photo_authorization", response = self.client.post(reverse("registration:upload_user_photo_authorization",
args=(self.student.registration.pk,)), data=dict( args=(self.student.registration.pk,)), data=dict(
photo_authorization=SimpleUploadedFile("file.pdf",content=int(0).to_bytes(2000001, "big"), photo_authorization=SimpleUploadedFile("file.pdf", content=int(0).to_bytes(2000001, "big"),
content_type="application/pdf"), content_type="application/pdf"),
)) ))
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)