mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-22 18:56:15 +02:00
Merge pull request #728 from cisagov/ik/fix-alt-domain
Update attribute for alternate domains
This commit is contained in:
commit
14f6a92f9f
2 changed files with 36 additions and 1 deletions
|
@ -498,7 +498,7 @@ class BaseAlternativeDomainFormSet(RegistrarFormSet):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def on_fetch(cls, query):
|
def on_fetch(cls, query):
|
||||||
return [{"alternative_domain": Domain.sld(domain.name)} for domain in query]
|
return [{"alternative_domain": Domain.sld(domain.website)} for domain in query]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def from_database(cls, obj):
|
def from_database(cls, obj):
|
||||||
|
|
|
@ -461,6 +461,41 @@ class DomainApplicationTests(TestWithUser, WebTest):
|
||||||
# check that any new pages are added to this test
|
# check that any new pages are added to this test
|
||||||
self.assertEqual(num_pages, num_pages_tested)
|
self.assertEqual(num_pages, num_pages_tested)
|
||||||
|
|
||||||
|
# This is the start of a test to check an existing application, it currently
|
||||||
|
# does not work and results in errors as noted in:
|
||||||
|
# https://github.com/cisagov/getgov/pull/728
|
||||||
|
@skip("WIP")
|
||||||
|
def test_application_form_started_allsteps(self):
|
||||||
|
num_pages_tested = 0
|
||||||
|
# elections, type_of_work, tribal_government, no_other_contacts
|
||||||
|
SKIPPED_PAGES = 4
|
||||||
|
DASHBOARD_PAGE = 1
|
||||||
|
num_pages = len(self.TITLES) - SKIPPED_PAGES + DASHBOARD_PAGE
|
||||||
|
|
||||||
|
application = completed_application(user=self.user)
|
||||||
|
application.save()
|
||||||
|
home_page = self.app.get("/")
|
||||||
|
self.assertContains(home_page, "city.gov")
|
||||||
|
self.assertContains(home_page, "Started")
|
||||||
|
num_pages_tested += 1
|
||||||
|
|
||||||
|
# TODO: For some reason this click results in a new application being generated
|
||||||
|
# This appraoch is an alternatie to using get as is being done below
|
||||||
|
#
|
||||||
|
# type_page = home_page.click("Edit")
|
||||||
|
|
||||||
|
session_id = self.app.cookies[settings.SESSION_COOKIE_NAME]
|
||||||
|
url = reverse("edit-application", kwargs={"id": application.pk})
|
||||||
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
|
||||||
|
# TODO: The following line results in a django error on middleware
|
||||||
|
response = self.client.get(url, follow=True)
|
||||||
|
self.assertContains(response, "Type of organization")
|
||||||
|
self.app.set_cookie(settings.SESSION_COOKIE_NAME, session_id)
|
||||||
|
# TODO: Step through the remaining pages
|
||||||
|
|
||||||
|
self.assertEqual(num_pages, num_pages_tested)
|
||||||
|
|
||||||
def test_application_form_conditional_federal(self):
|
def test_application_form_conditional_federal(self):
|
||||||
"""Federal branch question is shown for federal organizations."""
|
"""Federal branch question is shown for federal organizations."""
|
||||||
type_page = self.app.get(reverse("application:")).follow()
|
type_page = self.app.get(reverse("application:")).follow()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue