Fakultas Ilmu Komputer UI
Skip to content
GitLab
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
7f96a4ae
Commit
7f96a4ae
authored
May 15, 2020
by
Dave Nathanael
Browse files
Fix email account deactivation test
parent
aa2462ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
apps/accounts/migrations/0005_auto_20200515_0038.py
0 → 100644
View file @
7f96a4ae
# Generated by Django 3.0.1 on 2020-05-14 17:38
import
django.core.validators
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'accounts'
,
'0004_account_author'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'account'
,
name
=
'phone_number'
,
field
=
models
.
CharField
(
max_length
=
64
,
validators
=
[
django
.
core
.
validators
.
RegexValidator
(
message
=
'Phone number has 9-15 digits, allowed to have + prefix'
,
regex
=
'^
\\
+?
\\
d{9,15}$'
)]),
),
]
apps/accounts/tests/test_units/test_accounts.py
View file @
7f96a4ae
...
...
@@ -215,21 +215,23 @@ class AccountViewTest(APITestCase):
"id"
:
str
(
self
.
officer
.
id
),
"name"
:
self
.
faker
.
name
(),
"email"
:
self
.
faker
.
email
(),
"phone_number"
:
self
.
faker
.
phone_number
()
,
"phone_number"
:
"+999999999999"
,
"area"
:
self
.
faker
.
city
(),
"is_admin"
:
False
,
"is_verified"
:
True
,
"is_active"
:
Fals
e
,
"is_active"
:
Tru
e
,
}
prev_outbox_count
=
len
(
mail
.
outbox
)
self
.
client
=
APIClient
(
HTTP_AUTHORIZATION
=
HEADER_PREFIX
+
self
.
token_2
.
key
)
response
=
self
.
client
.
put
(
path
=
url
,
data
=
data
,
format
=
"json"
,)
data
[
"is_active"
]
=
False
response
=
self
.
client
.
put
(
path
=
url
,
data
=
data
,
format
=
"json"
,)
current_outbox_count
=
len
(
mail
.
outbox
)
# Account deactivation email sent
self
.
assertEqual
(
current_outbox_count
,
prev_outbox_count
+
1
)
self
.
assertEqual
(
current_outbox_count
,
prev_outbox_count
+
2
)
def
test_edit_account_fail_without_complete_fields
(
self
):
url
=
self
.
BASE_URL
+
str
(
self
.
officer
.
id
)
+
"/"
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment