Attempt to pull workspace owner details from form

This commit is contained in:
richard-dds
2018-08-23 14:18:19 -04:00
parent 70cc82a1e7
commit e97fbde054
3 changed files with 46 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ from atst.domain.roles import Roles
from atst.domain.requests import Requests
from urllib.parse import urlencode
from tests.assert_util import dict_contains
ERROR_CLASS = "alert--error"
@@ -161,6 +162,32 @@ def test_poc_details_can_be_autopopulated_on_new_request(client, user_session):
assert request.body["primary_poc"]["dodid_poc"] == creator.dod_id
def test_poc_autofill_checks_information_about_you_form_first(client, user_session):
creator = UserFactory.create()
user_session(creator)
request = RequestFactory.create(creator=creator, body={
"information_about_you": {
"fname_request": "Alice",
"lname_request": "Adams",
"email_request": "alice.adams@mail.mil"
}
})
poc_input = {
"am_poc": "yes",
}
client.post(
"/requests/new/3/{}".format(request.id),
headers={"Content-Type": "application/x-www-form-urlencoded"},
data=urlencode(poc_input),
)
request = Requests.get(request.id)
assert dict_contains(request.body["primary_poc"], {
"fname_poc": "Alice",
"lname_poc": "Adams",
"email_poc": "alice.adams@mail.mil"
})
def test_can_review_data(user_session, client):
creator = UserFactory.create()
user_session(creator)