Commit 1f879ff4 authored by Tanner Prestegard's avatar Tanner Prestegard Committed by GraceDB

Add/update alerts unit tests

Add a whole suite of tests for phone and email alerts. Small update
to a few unit tests for alert views.
parent e2c5f81b
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -22,6 +22,10 @@ class TestUpdateContactView(GraceDbTestBase):
description='test phone', phone='12345678901',
phone_method=Contact.CONTACT_PHONE_BOTH)
# Refresh from database to get formatted phone numbers
cls.email_contact.refresh_from_db()
cls.phone_contact.refresh_from_db()
def test_edit_email(self):
"""Users should not be able to update contact email"""
# (because it sidesteps the verification process)
......@@ -35,6 +39,9 @@ class TestUpdateContactView(GraceDbTestBase):
response = self.request_as_user(url, "POST", self.internal_user,
data=data)
# Response = 302 means success and redirect to main alerts page
self.assertEqual(response.status_code, 302)
# Refresh from database
self.email_contact.refresh_from_db()
......@@ -58,6 +65,9 @@ class TestUpdateContactView(GraceDbTestBase):
response = self.request_as_user(url, "POST", self.internal_user,
data=data)
# Response = 302 means success and redirect to main alerts page
self.assertEqual(response.status_code, 302)
# Refresh from database
self.phone_contact.refresh_from_db()
......
Markdown is supported
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