Fakultas Ilmu Komputer UI

Commit 263b4ecb authored by Dave Nathanael's avatar Dave Nathanael
Browse files

Merge branch 'dave/fix-email-account-deactivation-test' into 'staging'

Fix email account deactivation test

See merge request !50
parents aa2462ba 7f96a4ae
Pipeline #47242 passed with stages
in 4 minutes and 49 seconds
# 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}$')]),
),
]
......@@ -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": False,
"is_active": True,
}
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) + "/"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment