Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tdt4242-ex2
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jørgen Hollum
tdt4242-ex2
Commits
e8f37f90
Commit
e8f37f90
authored
2 years ago
by
Sigurd
Browse files
Options
Downloads
Patches
Plain Diff
twoway cleaned up imports
parent
604d6ec7
Branches
backend/testing
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#167213
passed with stage
in 26 seconds
Changes
1
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/secfit/users/tests/test_twoway.py
+5
-7
5 additions, 7 deletions
backend/secfit/users/tests/test_twoway.py
with
5 additions
and
7 deletions
backend/secfit/users/tests/test_twoway.py
+
5
−
7
View file @
e8f37f90
from
threading
import
local
from
django.test
import
TestCase
,
RequestFactory
,
Client
from
users.models
import
User
from
users.serializers
import
UserSerializer
from
django.test
import
TestCase
,
Client
class
TwoWayDomainTest
(
TestCase
):
def
setUp
(
self
):
self
.
client
=
Client
()
self
.
test_cases_data
=
[
#
All
Valid
#Valid
{
"
username
"
:
"
jorsi
"
,
"
email
"
:
"
some@mail.com
"
,
...
...
@@ -20,7 +19,7 @@ class TwoWayDomainTest(TestCase):
"
favourite_exercise
"
:
"
curl
"
,
"
main_gym
"
:
"
SIT
"
,
},
#
U
sername, email, password
,
password1 invalid
#
Rest are invalid, first with several(u
sername, email, password
and
password1
)
invalid
inputs, then changing one by one
{
"
username
"
:
"
//
"
,
"
email
"
:
"
/&
"
,
...
...
@@ -33,7 +32,6 @@ class TwoWayDomainTest(TestCase):
"
favourite_exercise
"
:
"
curl
"
,
"
main_gym
"
:
"
SIT
"
,
},
# One by one after this
{
"
username
"
:
"
//
"
,
"
email
"
:
"
some@mail.com
"
,
...
...
@@ -84,7 +82,7 @@ class TwoWayDomainTest(TestCase):
},
]
def
test_
regi
(
self
):
def
test_
twoway_domain_test
(
self
):
for
case
in
self
.
test_cases_data
:
response
=
self
.
client
.
post
(
'
/api/users/
'
,
case
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment