Merge lp:~jaboing/canonical-identity-provider/sso into lp:canonical-identity-provider/release

Proposed by Julien Funk
Status: Merged
Approved by: Ricardo Kirkner
Approved revision: no longer in the source branch.
Merged at revision: 401
Proposed branch: lp:~jaboing/canonical-identity-provider/sso
Merge into: lp:canonical-identity-provider/release
Diff against target: 218 lines (+25/-24)
10 files modified
identityprovider/tests/acceptance/devices/add_device.py (+2/-2)
identityprovider/tests/acceptance/devices/add_device_google.py (+2/-2)
identityprovider/tests/acceptance/devices/add_device_yubikey.py (+2/-2)
identityprovider/tests/acceptance/devices/add_two_devices.py (+3/-3)
identityprovider/tests/acceptance/devices/delete_device.py (+2/-2)
identityprovider/tests/acceptance/devices/login.py (+1/-1)
identityprovider/tests/acceptance/devices/prefs.py (+1/-1)
identityprovider/tests/acceptance/devices/rename_device.py (+7/-7)
identityprovider/tests/acceptance/logout/logout_deep_pages.py (+1/-1)
identityprovider/tests/acceptance/views_protected.py (+4/-3)
To merge this branch: bzr merge lp:~jaboing/canonical-identity-provider/sso
Reviewer Review Type Date Requested Status
Ricardo Kirkner Pending
Review via email: mp+103393@code.launchpad.net

Commit message

Updated device names to be test-specific, removed saml from views_protected.py

Description of the change

Updated device names to be test-specific, removed saml from views_protected.py. 2F Tests are confirmed to pass agaisnt Staging.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'identityprovider/tests/acceptance/devices/add_device.py'
--- identityprovider/tests/acceptance/devices/add_device.py 2012-04-20 02:53:58 +0000
+++ identityprovider/tests/acceptance/devices/add_device.py 2012-04-24 23:00:25 +0000
@@ -91,7 +91,7 @@
91fails(get_element, 'otp-error')91fails(get_element, 'otp-error')
9292
93# Add a name93# Add a name
94write_textfield(get_element(tag='input', name='name'), 'My Generic Device')94write_textfield(get_element(tag='input', name='name'), 'add_device')
95# Click "Add device"95# Click "Add device"
96click_add_device_button()96click_add_device_button()
97# Check we are returned to the devices-list page97# Check we are returned to the devices-list page
@@ -107,7 +107,7 @@
107# Check our new device is now in the table, with the correct name107# Check our new device is now in the table, with the correct name
108assert_table_has_rows('device-list', 1)108assert_table_has_rows('device-list', 1)
109assert_table_row_contains_text('device-list', 0,109assert_table_row_contains_text('device-list', 0,
110 ['My Generic Device', 'Delete'], regex=True)110 ['add_device', 'Delete'], regex=True)
111111
112# Clean up, delete the device112# Clean up, delete the device
113otp = hotp.hotp(aes_key, 1)113otp = hotp.hotp(aes_key, 1)
114114
=== modified file 'identityprovider/tests/acceptance/devices/add_device_google.py'
--- identityprovider/tests/acceptance/devices/add_device_google.py 2012-04-07 04:04:27 +0000
+++ identityprovider/tests/acceptance/devices/add_device_google.py 2012-04-24 23:00:25 +0000
@@ -47,7 +47,7 @@
4747
48# set device name48# set device name
49name = get_element(tag='input', name='name')49name = get_element(tag='input', name='name')
50write_textfield(name, 'My Google Device')50write_textfield(name, 'add_device_google')
5151
52# Add correctly generated OTP52# Add correctly generated OTP
53valid_otp = hotp.hotp(aes_key, 0)53valid_otp = hotp.hotp(aes_key, 0)
@@ -59,7 +59,7 @@
59# Check our new device is now in the table, with the correct name59# Check our new device is now in the table, with the correct name
60assert_table_has_rows('device-list', 1)60assert_table_has_rows('device-list', 1)
61assert_table_row_contains_text('device-list', 0,61assert_table_row_contains_text('device-list', 0,
62 ['My Google Device', 'Delete'], regex=True)62 ['add_device_google', 'Delete'], regex=True)
6363
64# clean up afterward, delete device64# clean up afterward, delete device
65delete_device()65delete_device()
6666
=== modified file 'identityprovider/tests/acceptance/devices/add_device_yubikey.py'
--- identityprovider/tests/acceptance/devices/add_device_yubikey.py 2012-04-07 04:04:27 +0000
+++ identityprovider/tests/acceptance/devices/add_device_yubikey.py 2012-04-24 23:00:25 +0000
@@ -28,7 +28,7 @@
2828
29# set device name29# set device name
30name = get_element(tag='input', name='name')30name = get_element(tag='input', name='name')
31write_textfield(name, 'My YubiKey')31write_textfield(name, 'add_device_yubikey')
3232
33# Add correctly generated OTP33# Add correctly generated OTP
34aes_key = get_element(name='hex_key').get_attribute('value')34aes_key = get_element(name='hex_key').get_attribute('value')
@@ -41,7 +41,7 @@
41# Check our new device is now in the table, with the correct name41# Check our new device is now in the table, with the correct name
42assert_table_has_rows('device-list', 1)42assert_table_has_rows('device-list', 1)
43assert_table_row_contains_text('device-list', 0,43assert_table_row_contains_text('device-list', 0,
44 ['My YubiKey', 'Delete'], regex=True)44 ['add_device_yubikey', 'Delete'], regex=True)
4545
46# clean up afterward, delete device46# clean up afterward, delete device
47delete_device()47delete_device()
4848
=== modified file 'identityprovider/tests/acceptance/devices/add_two_devices.py'
--- identityprovider/tests/acceptance/devices/add_two_devices.py 2012-04-20 02:53:58 +0000
+++ identityprovider/tests/acceptance/devices/add_two_devices.py 2012-04-24 23:00:25 +0000
@@ -18,7 +18,7 @@
18helpers.login_or_register_account()18helpers.login_or_register_account()
1919
20# Add an authentication device20# Add an authentication device
21aes_key_1 = add_device('This device')21aes_key_1 = add_device('add_two_devices')
2222
23# Logout and back in so we are no longer 2f-authenticated23# Logout and back in so we are no longer 2f-authenticated
24helpers.logout_and_in()24helpers.logout_and_in()
@@ -36,7 +36,7 @@
36click_add_device_button()36click_add_device_button()
3737
38# Add a name for the second device38# Add a name for the second device
39write_textfield(get_element(tag='input', name='name'), 'This device')39write_textfield(get_element(tag='input', name='name'), 'add_two_devices')
4040
41# Enter OTP41# Enter OTP
42aes_key_2 = get_element(name='hex_key').get_attribute('value')42aes_key_2 = get_element(name='hex_key').get_attribute('value')
@@ -50,7 +50,7 @@
50# Check our new device is now in the table, with the correct name50# Check our new device is now in the table, with the correct name
51assert_table_has_rows('device-list', 2)51assert_table_has_rows('device-list', 2)
52assert_table_row_contains_text('device-list', 1,52assert_table_row_contains_text('device-list', 1,
53 ['This device (1)', 'Rename Delete'])53 ['add_two_devices (1)', 'Rename Delete'])
5454
55# Change the preference to always require 2 factor authentication and save55# Change the preference to always require 2 factor authentication and save
56set_radio_value(get_element(tag="input", name="two-factor", value="always"))56set_radio_value(get_element(tag="input", name="two-factor", value="always"))
5757
=== modified file 'identityprovider/tests/acceptance/devices/delete_device.py'
--- identityprovider/tests/acceptance/devices/delete_device.py 2012-04-07 04:04:27 +0000
+++ identityprovider/tests/acceptance/devices/delete_device.py 2012-04-24 23:00:25 +0000
@@ -13,7 +13,7 @@
13helpers.login_or_register_account()13helpers.login_or_register_account()
1414
15# Add an authentication device15# Add an authentication device
16aes_key = add_device('This device')16aes_key = add_device('delete_device')
1717
18# Logout and back in so we are no longer 2f-authenticated18# Logout and back in so we are no longer 2f-authenticated
19helpers.logout_and_in()19helpers.logout_and_in()
@@ -29,7 +29,7 @@
29# Check the url has changed appropriately29# Check the url has changed appropriately
30assert_url_contains('/device-removal/\d+', regex=True)30assert_url_contains('/device-removal/\d+', regex=True)
31# and the correct device headline is shown31# and the correct device headline is shown
32assert_element(tag='h2', text='This device')32assert_element(tag='h2', text='delete_device')
3333
34# Click on cancel34# Click on cancel
35click_link(get_element(tag='a', text='cancel'))35click_link(get_element(tag='a', text='cancel'))
3636
=== modified file 'identityprovider/tests/acceptance/devices/login.py'
--- identityprovider/tests/acceptance/devices/login.py 2012-04-20 02:53:58 +0000
+++ identityprovider/tests/acceptance/devices/login.py 2012-04-24 23:00:25 +0000
@@ -17,7 +17,7 @@
17click_link('devices-link')17click_link('devices-link')
1818
19# Add an authentication device19# Add an authentication device
20aes_key = add_device()20aes_key = add_device('login')
2121
22# Change the preference to always require 2 factor authentication and save22# Change the preference to always require 2 factor authentication and save
23set_radio_value(get_element(tag="input", name="two-factor", value="always"))23set_radio_value(get_element(tag="input", name="two-factor", value="always"))
2424
=== modified file 'identityprovider/tests/acceptance/devices/prefs.py'
--- identityprovider/tests/acceptance/devices/prefs.py 2012-04-20 02:53:58 +0000
+++ identityprovider/tests/acceptance/devices/prefs.py 2012-04-24 23:00:25 +0000
@@ -24,7 +24,7 @@
24 disabled="disabled")24 disabled="disabled")
2525
26# Add an authentication device26# Add an authentication device
27aes_key = add_device()27aes_key = add_device('prefs')
2828
29# Test preferences form is now enabled29# Test preferences form is now enabled
30assert_attribute(get_element(tag="input", name="two-factor", value="always"),30assert_attribute(get_element(tag="input", name="two-factor", value="always"),
3131
=== modified file 'identityprovider/tests/acceptance/devices/rename_device.py'
--- identityprovider/tests/acceptance/devices/rename_device.py 2012-04-07 04:04:27 +0000
+++ identityprovider/tests/acceptance/devices/rename_device.py 2012-04-24 23:00:25 +0000
@@ -17,24 +17,24 @@
17helpers.login_or_register_account()17helpers.login_or_register_account()
1818
19# add a new device with unicode character and white space19# add a new device with unicode character and white space
20name = 'device name'20name = 'rename_device'
21add_device(name)21add_device(name)
22# make sure device exists22# make sure device exists
23assert_device(name)23assert_device(name)
24assert_no_device('new-device')24assert_no_device('rename_device_new')
25# rename device25# rename device
26rename_device(name, 'new-device')26rename_device(name, 'rename_device_new')
27# confirm device renamed27# confirm device renamed
28assert_device('new-device')28assert_device('rename_device_new')
29assert_no_device(name)29assert_no_device(name)
3030
31# sad paths31# sad paths
3232
33# rename escapes content33# rename escapes content
34name = '<script>alert("hi");</script>'34name = '<script>alert("rename_device");</script>'
35rename_device('new-device', name)35rename_device('rename_device_new', name)
36assert_device(name)36assert_device(name)
37assert_no_device('new-device')37assert_no_device('rename_device_new')
3838
39# try to rename to empty string39# try to rename to empty string
40rename_device(name, '')40rename_device(name, '')
4141
=== modified file 'identityprovider/tests/acceptance/logout/logout_deep_pages.py'
--- identityprovider/tests/acceptance/logout/logout_deep_pages.py 2012-04-20 02:53:58 +0000
+++ identityprovider/tests/acceptance/logout/logout_deep_pages.py 2012-04-24 23:00:25 +0000
@@ -13,7 +13,7 @@
1313
14# Create account or login, then add a device14# Create account or login, then add a device
15helpers.login_or_register_account()15helpers.login_or_register_account()
16aes_key = add_device('This device')16aes_key = add_device('logout_deep_pages')
1717
18# Logout and back in so we are no longer 2f-authenticated18# Logout and back in so we are no longer 2f-authenticated
19helpers.logout_and_in()19helpers.logout_and_in()
2020
=== modified file 'identityprovider/tests/acceptance/views_protected.py'
--- identityprovider/tests/acceptance/views_protected.py 2012-04-24 17:54:54 +0000
+++ identityprovider/tests/acceptance/views_protected.py 2012-04-24 23:00:25 +0000
@@ -15,7 +15,7 @@
15# Create account or login to test account15# Create account or login to test account
16helpers.login_or_register_account()16helpers.login_or_register_account()
17# Add an authentication device17# Add an authentication device
18aes_key = add_device('This device')18aes_key = add_device('views_protected')
19helpers.logout_and_in()19helpers.logout_and_in()
2020
21# Change the preference to always require 2 factor authentication and save21# Change the preference to always require 2 factor authentication and save
@@ -32,8 +32,9 @@
32helpers.check_2f_for_url('/+new-email')32helpers.check_2f_for_url('/+new-email')
33helpers.check_2f_for_url('/+verify-email')33helpers.check_2f_for_url('/+verify-email')
34helpers.check_2f_for_url('/+remove-email')34helpers.check_2f_for_url('/+remove-email')
35helpers.check_2f_for_url('/+saml')35# uncomment the following after we have a fully functional saml implementation
36helpers.check_2f_for_url('/+saml/process')36#helpers.check_2f_for_url('/+saml')
37#helpers.check_2f_for_url('/+saml/process')
3738
3839
39helpers.login()40helpers.login()