mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-23 19:20:47 +02:00
refactored test
This commit is contained in:
parent
294fbee5c3
commit
f3159b57e4
1 changed files with 8 additions and 2 deletions
|
@ -737,6 +737,12 @@ class TestDomainManagers(TestDomainOverview):
|
|||
def test_domain_invitation_flow(self):
|
||||
"""Send an invitation to a new user, log in and load the dashboard."""
|
||||
email_address = "mayor@igorville.gov"
|
||||
username="mayor"
|
||||
first_name = "First"
|
||||
last_name = "Last"
|
||||
title = "title"
|
||||
phone = "8080102431"
|
||||
title="title"
|
||||
User.objects.filter(email=email_address).delete()
|
||||
|
||||
add_page = self.app.get(reverse("domain-users-add", kwargs={"pk": self.domain.id}))
|
||||
|
@ -752,14 +758,14 @@ class TestDomainManagers(TestDomainOverview):
|
|||
add_page.form.submit()
|
||||
|
||||
# user was invited, create them
|
||||
new_user = User.objects.create(username=email_address, email=email_address)
|
||||
new_user = User.objects.create(username=username, email=email_address, first_name=first_name, last_name=last_name, title=title, phone=phone)
|
||||
# log them in to `self.app`
|
||||
self.app.set_user(new_user.username)
|
||||
# and manually call the on each login callback
|
||||
new_user.on_each_login()
|
||||
|
||||
# Now load the home page and make sure our domain appears there
|
||||
home_page = self.app.get(reverse("user-profile"))
|
||||
home_page = self.app.get(reverse("home"))
|
||||
self.assertContains(home_page, self.domain.name)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue