Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
2020
PPL-C
PPTI-Mobile Apps Monitoring Wabah Tuberkolosis
Neza-Backend
Commits
2089805a
Commit
2089805a
authored
Apr 29, 2020
by
Jonathan Christopher Jakub
Browse files
[RED] Add handler for existing users
parent
17583834
Pipeline
#43983
failed with stages
in 1 minute and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
apps/accounts/tests/test_units/test_accounts.py
View file @
2089805a
...
...
@@ -137,6 +137,22 @@ class AccountViewTest(APITestCase):
f
'"action_type":"
{
ACTIVITY_TYPE_CREATE
}
"'
,
response_string
)
def
test_create_existing_user_fails
(
self
):
url
=
self
.
BASE_URL
data
=
{
"name"
:
self
.
faker
.
name
(),
"username"
:
"user_1"
,
"password"
:
"justpass"
,
"email"
:
self
.
faker
.
email
(),
"phone_number"
:
self
.
faker
.
phone_number
(),
"area"
:
self
.
faker
.
city
(),
"is_admin"
:
False
,
"is_verified"
:
True
,
"is_active"
:
True
,
}
response
=
self
.
client
.
post
(
path
=
url
,
data
=
data
,
format
=
"json"
,)
self
.
assertEqual
(
response
.
status_code
,
status
.
HTTP_409_CONFLICT
)
def
test_create_new_account_fails_with_poor_password
(
self
):
url
=
self
.
BASE_URL
_account_id
=
self
.
faker
.
email
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment