-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#2248] Make contact details editable for eHerkenning user
- Loading branch information
Showing
3 changed files
with
31 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -223,7 +223,7 @@ def test_info_eherkenning_user(self): | |
doc = PQ(response.content) | ||
|
||
business_section = doc.find("#business-overview")[0] | ||
self.assertEqual(business_section.text, "Bedrijfsgegevens") | ||
self.assertEqual(business_section.text.strip(), "Bedrijfsgegevens") | ||
|
||
# check personal overview section not displayed | ||
personal_section = doc.find("#personal-overview") | ||
|
@@ -290,6 +290,7 @@ def setUp(self): | |
self.url = reverse("profile:edit") | ||
self.return_url = reverse("profile:detail") | ||
self.user = UserFactory() | ||
self.eherkenning_user = eHerkenningUserFactory() | ||
|
||
def upload_test_image_to_profile_edit_page(self, img_bytes): | ||
response = self.app.get(self.url, user=self.user, status=200) | ||
|
@@ -394,6 +395,17 @@ def test_modify_email_succeeds(self): | |
self.assertEqual(response.url, self.return_url) | ||
self.assertEqual(self.user.email, "[email protected]") | ||
|
||
def test_modify_contact_details_eherkenning_succeeds(self): | ||
response = self.app.get(self.url, user=self.eherkenning_user) | ||
form = response.forms["profile-edit"] | ||
form["email"] = "[email protected]" | ||
form["phonenumber"] = "0612345678" | ||
response = form.submit() | ||
self.eherkenning_user.refresh_from_db() | ||
self.assertEqual(response.url, self.return_url) | ||
self.assertEqual(self.eherkenning_user.email, "[email protected]") | ||
self.assertEqual(self.eherkenning_user.phonenumber, "0612345678") | ||
|
||
def test_updating_a_field_without_modifying_email_succeeds(self): | ||
initial_email = self.user.email | ||
initial_first_name = self.user.first_name | ||
|
@@ -633,7 +645,7 @@ def test_modify_phone_updates_klant_api_but_skip_unchanged_email(self, m): | |
) | ||
|
||
@requests_mock.Mocker() | ||
def test_modify_phone_updates_klant_api_but_skip_unchanged_phone(self, m): | ||
def test_modify_email_updates_klant_api_but_skip_unchanged_phone(self, m): | ||
MockAPIReadPatchData.setUpServices() | ||
data = MockAPIReadPatchData().install_mocks(m) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters