Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDT4242-group15
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
Vegard Murvold Sporstøl
TDT4242-group15
Commits
1e96df7c
Commit
1e96df7c
authored
4 years ago
by
Vegard Murvold Sporstøl
Browse files
Options
Downloads
Patches
Plain Diff
inital test for user registration
parent
ec4c907e
No related branches found
Branches containing commit
No related tags found
1 merge request
!7
Task3
Pipeline
#113566
passed
4 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/secfit/users/tests.py
+21
-1
21 additions, 1 deletion
backend/secfit/users/tests.py
with
21 additions
and
1 deletion
backend/secfit/users/tests.py
+
21
−
1
View file @
1e96df7c
import
json
from
django.contrib.auth.models
import
User
from
django.urls
import
reverse
from
rest_framework
import
status
from
rest_framework.authtoken.models
import
Token
from
rest_framework.test
import
APITestCase
from
users.serializers
import
UserSerializer
from
users.models
import
User
from
django.test
import
TestCase
# Create your tests here.
class
RegistrationTestCase
(
APITestCase
):
def
test_registration
(
self
):
data
=
{
"
username
"
:
"
testcase
"
,
"
email
"
:
"
test@test.no
"
,
"
password
"
:
"
strong_pwd
"
,
"
password1
"
:
"
strong_pwd
"
,
"
phone_number
"
:
"
95080764
"
,
"
country
"
:
"
Norway
"
,
"
city
"
:
"
Trondheim
"
,
"
street_address
"
:
"
Tors Veg 11C
"
}
response
=
self
.
client
.
post
(
"
/api/users/
"
,
data
)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_201_CREATED
)
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