diff --git a/tests/test_admin_pages.py b/tests/test_admin_pages.py index e2ca8e335..5739c720a 100644 --- a/tests/test_admin_pages.py +++ b/tests/test_admin_pages.py @@ -165,8 +165,8 @@ def test_forms(pub): assert not 'New Form' in resp.body def test_forms_new(pub): - app = login(get_app(pub)) user = create_superuser(pub) + app = login(get_app(pub)) create_role() # create a new form @@ -187,6 +187,31 @@ def test_forms_new(pub): assert formdef.disabled == True assert formdef.last_modification_user_id == str(user.id) +def test_forms_new_popup(pub): + FormDef.wipe() + user = create_superuser(pub) + app = login(get_app(pub)) + create_role() + + # create a new form + resp = app.get('/backoffice/forms/') + assert 'New Form' in resp.body + resp = resp.click('New Form', extra_environ={'HTTP_X_POPUP': 'true'}) + assert 'popup-content' in resp.body + resp.forms[0]['name'] = 'form title' + resp = resp.forms[0].submit() + assert resp.location == 'http://example.net/backoffice/forms/1/' + resp = resp.follow() + assert '