Skip to content
Snippets Groups Projects
Commit e8f37f90 authored by Sigurd's avatar Sigurd
Browse files

twoway cleaned up imports

parent 604d6ec7
No related branches found
No related tags found
No related merge requests found
Pipeline #167213 passed
from threading import local from threading import local
from django.test import TestCase, RequestFactory, Client from django.test import TestCase, Client
from users.models import User
from users.serializers import UserSerializer
class TwoWayDomainTest(TestCase): class TwoWayDomainTest(TestCase):
def setUp(self): def setUp(self):
self.client = Client() self.client = Client()
self.test_cases_data =[ self.test_cases_data =[
#All Valid #Valid
{ {
"username" : "jorsi", "username" : "jorsi",
"email" : "some@mail.com", "email" : "some@mail.com",
...@@ -20,7 +19,7 @@ class TwoWayDomainTest(TestCase): ...@@ -20,7 +19,7 @@ class TwoWayDomainTest(TestCase):
"favourite_exercise" : "curl", "favourite_exercise" : "curl",
"main_gym" :"SIT", "main_gym" :"SIT",
}, },
#Username, email, password, password1 invalid #Rest are invalid, first with several(username, email, password and password1) invalid inputs, then changing one by one
{ {
"username" : "//", "username" : "//",
"email" : "/&", "email" : "/&",
...@@ -33,7 +32,6 @@ class TwoWayDomainTest(TestCase): ...@@ -33,7 +32,6 @@ class TwoWayDomainTest(TestCase):
"favourite_exercise" : "curl", "favourite_exercise" : "curl",
"main_gym" :"SIT", "main_gym" :"SIT",
}, },
# One by one after this
{ {
"username" : "//", "username" : "//",
"email" : "some@mail.com", "email" : "some@mail.com",
...@@ -84,7 +82,7 @@ class TwoWayDomainTest(TestCase): ...@@ -84,7 +82,7 @@ class TwoWayDomainTest(TestCase):
}, },
] ]
def test_regi(self): def test_twoway_domain_test(self):
for case in self.test_cases_data: for case in self.test_cases_data:
response = self.client.post('/api/users/', case) response = self.client.post('/api/users/', case)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment