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
1=== modified file 'identityprovider/tests/acceptance/devices/add_device.py'
2--- identityprovider/tests/acceptance/devices/add_device.py 2012-04-20 02:53:58 +0000
3+++ identityprovider/tests/acceptance/devices/add_device.py 2012-04-24 23:00:25 +0000
4@@ -91,7 +91,7 @@
5 fails(get_element, 'otp-error')
6
7 # Add a name
8-write_textfield(get_element(tag='input', name='name'), 'My Generic Device')
9+write_textfield(get_element(tag='input', name='name'), 'add_device')
10 # Click "Add device"
11 click_add_device_button()
12 # Check we are returned to the devices-list page
13@@ -107,7 +107,7 @@
14 # Check our new device is now in the table, with the correct name
15 assert_table_has_rows('device-list', 1)
16 assert_table_row_contains_text('device-list', 0,
17- ['My Generic Device', 'Delete'], regex=True)
18+ ['add_device', 'Delete'], regex=True)
19
20 # Clean up, delete the device
21 otp = hotp.hotp(aes_key, 1)
22
23=== modified file 'identityprovider/tests/acceptance/devices/add_device_google.py'
24--- identityprovider/tests/acceptance/devices/add_device_google.py 2012-04-07 04:04:27 +0000
25+++ identityprovider/tests/acceptance/devices/add_device_google.py 2012-04-24 23:00:25 +0000
26@@ -47,7 +47,7 @@
27
28 # set device name
29 name = get_element(tag='input', name='name')
30-write_textfield(name, 'My Google Device')
31+write_textfield(name, 'add_device_google')
32
33 # Add correctly generated OTP
34 valid_otp = hotp.hotp(aes_key, 0)
35@@ -59,7 +59,7 @@
36 # Check our new device is now in the table, with the correct name
37 assert_table_has_rows('device-list', 1)
38 assert_table_row_contains_text('device-list', 0,
39- ['My Google Device', 'Delete'], regex=True)
40+ ['add_device_google', 'Delete'], regex=True)
41
42 # clean up afterward, delete device
43 delete_device()
44
45=== modified file 'identityprovider/tests/acceptance/devices/add_device_yubikey.py'
46--- identityprovider/tests/acceptance/devices/add_device_yubikey.py 2012-04-07 04:04:27 +0000
47+++ identityprovider/tests/acceptance/devices/add_device_yubikey.py 2012-04-24 23:00:25 +0000
48@@ -28,7 +28,7 @@
49
50 # set device name
51 name = get_element(tag='input', name='name')
52-write_textfield(name, 'My YubiKey')
53+write_textfield(name, 'add_device_yubikey')
54
55 # Add correctly generated OTP
56 aes_key = get_element(name='hex_key').get_attribute('value')
57@@ -41,7 +41,7 @@
58 # Check our new device is now in the table, with the correct name
59 assert_table_has_rows('device-list', 1)
60 assert_table_row_contains_text('device-list', 0,
61- ['My YubiKey', 'Delete'], regex=True)
62+ ['add_device_yubikey', 'Delete'], regex=True)
63
64 # clean up afterward, delete device
65 delete_device()
66
67=== modified file 'identityprovider/tests/acceptance/devices/add_two_devices.py'
68--- identityprovider/tests/acceptance/devices/add_two_devices.py 2012-04-20 02:53:58 +0000
69+++ identityprovider/tests/acceptance/devices/add_two_devices.py 2012-04-24 23:00:25 +0000
70@@ -18,7 +18,7 @@
71 helpers.login_or_register_account()
72
73 # Add an authentication device
74-aes_key_1 = add_device('This device')
75+aes_key_1 = add_device('add_two_devices')
76
77 # Logout and back in so we are no longer 2f-authenticated
78 helpers.logout_and_in()
79@@ -36,7 +36,7 @@
80 click_add_device_button()
81
82 # Add a name for the second device
83-write_textfield(get_element(tag='input', name='name'), 'This device')
84+write_textfield(get_element(tag='input', name='name'), 'add_two_devices')
85
86 # Enter OTP
87 aes_key_2 = get_element(name='hex_key').get_attribute('value')
88@@ -50,7 +50,7 @@
89 # Check our new device is now in the table, with the correct name
90 assert_table_has_rows('device-list', 2)
91 assert_table_row_contains_text('device-list', 1,
92- ['This device (1)', 'Rename Delete'])
93+ ['add_two_devices (1)', 'Rename Delete'])
94
95 # Change the preference to always require 2 factor authentication and save
96 set_radio_value(get_element(tag="input", name="two-factor", value="always"))
97
98=== modified file 'identityprovider/tests/acceptance/devices/delete_device.py'
99--- identityprovider/tests/acceptance/devices/delete_device.py 2012-04-07 04:04:27 +0000
100+++ identityprovider/tests/acceptance/devices/delete_device.py 2012-04-24 23:00:25 +0000
101@@ -13,7 +13,7 @@
102 helpers.login_or_register_account()
103
104 # Add an authentication device
105-aes_key = add_device('This device')
106+aes_key = add_device('delete_device')
107
108 # Logout and back in so we are no longer 2f-authenticated
109 helpers.logout_and_in()
110@@ -29,7 +29,7 @@
111 # Check the url has changed appropriately
112 assert_url_contains('/device-removal/\d+', regex=True)
113 # and the correct device headline is shown
114-assert_element(tag='h2', text='This device')
115+assert_element(tag='h2', text='delete_device')
116
117 # Click on cancel
118 click_link(get_element(tag='a', text='cancel'))
119
120=== modified file 'identityprovider/tests/acceptance/devices/login.py'
121--- identityprovider/tests/acceptance/devices/login.py 2012-04-20 02:53:58 +0000
122+++ identityprovider/tests/acceptance/devices/login.py 2012-04-24 23:00:25 +0000
123@@ -17,7 +17,7 @@
124 click_link('devices-link')
125
126 # Add an authentication device
127-aes_key = add_device()
128+aes_key = add_device('login')
129
130 # Change the preference to always require 2 factor authentication and save
131 set_radio_value(get_element(tag="input", name="two-factor", value="always"))
132
133=== modified file 'identityprovider/tests/acceptance/devices/prefs.py'
134--- identityprovider/tests/acceptance/devices/prefs.py 2012-04-20 02:53:58 +0000
135+++ identityprovider/tests/acceptance/devices/prefs.py 2012-04-24 23:00:25 +0000
136@@ -24,7 +24,7 @@
137 disabled="disabled")
138
139 # Add an authentication device
140-aes_key = add_device()
141+aes_key = add_device('prefs')
142
143 # Test preferences form is now enabled
144 assert_attribute(get_element(tag="input", name="two-factor", value="always"),
145
146=== modified file 'identityprovider/tests/acceptance/devices/rename_device.py'
147--- identityprovider/tests/acceptance/devices/rename_device.py 2012-04-07 04:04:27 +0000
148+++ identityprovider/tests/acceptance/devices/rename_device.py 2012-04-24 23:00:25 +0000
149@@ -17,24 +17,24 @@
150 helpers.login_or_register_account()
151
152 # add a new device with unicode character and white space
153-name = 'device name'
154+name = 'rename_device'
155 add_device(name)
156 # make sure device exists
157 assert_device(name)
158-assert_no_device('new-device')
159+assert_no_device('rename_device_new')
160 # rename device
161-rename_device(name, 'new-device')
162+rename_device(name, 'rename_device_new')
163 # confirm device renamed
164-assert_device('new-device')
165+assert_device('rename_device_new')
166 assert_no_device(name)
167
168 # sad paths
169
170 # rename escapes content
171-name = '<script>alert("hi");</script>'
172-rename_device('new-device', name)
173+name = '<script>alert("rename_device");</script>'
174+rename_device('rename_device_new', name)
175 assert_device(name)
176-assert_no_device('new-device')
177+assert_no_device('rename_device_new')
178
179 # try to rename to empty string
180 rename_device(name, '')
181
182=== modified file 'identityprovider/tests/acceptance/logout/logout_deep_pages.py'
183--- identityprovider/tests/acceptance/logout/logout_deep_pages.py 2012-04-20 02:53:58 +0000
184+++ identityprovider/tests/acceptance/logout/logout_deep_pages.py 2012-04-24 23:00:25 +0000
185@@ -13,7 +13,7 @@
186
187 # Create account or login, then add a device
188 helpers.login_or_register_account()
189-aes_key = add_device('This device')
190+aes_key = add_device('logout_deep_pages')
191
192 # Logout and back in so we are no longer 2f-authenticated
193 helpers.logout_and_in()
194
195=== modified file 'identityprovider/tests/acceptance/views_protected.py'
196--- identityprovider/tests/acceptance/views_protected.py 2012-04-24 17:54:54 +0000
197+++ identityprovider/tests/acceptance/views_protected.py 2012-04-24 23:00:25 +0000
198@@ -15,7 +15,7 @@
199 # Create account or login to test account
200 helpers.login_or_register_account()
201 # Add an authentication device
202-aes_key = add_device('This device')
203+aes_key = add_device('views_protected')
204 helpers.logout_and_in()
205
206 # Change the preference to always require 2 factor authentication and save
207@@ -32,8 +32,9 @@
208 helpers.check_2f_for_url('/+new-email')
209 helpers.check_2f_for_url('/+verify-email')
210 helpers.check_2f_for_url('/+remove-email')
211-helpers.check_2f_for_url('/+saml')
212-helpers.check_2f_for_url('/+saml/process')
213+# uncomment the following after we have a fully functional saml implementation
214+#helpers.check_2f_for_url('/+saml')
215+#helpers.check_2f_for_url('/+saml/process')
216
217
218 helpers.login()