Merge lp:~elopio/canonical-identity-provider/django-cancel_addition into lp:canonical-identity-provider/release

Proposed by Leo Arias
Status: Rejected
Rejected by: Natalia Bidart
Proposed branch: lp:~elopio/canonical-identity-provider/django-cancel_addition
Merge into: lp:canonical-identity-provider/release
Diff against target: 55 lines (+13/-11)
2 files modified
acceptance/tests/devices/test_add_device.py (+0/-5)
webui/tests/test_devices.py (+13/-6)
To merge this branch: bzr merge lp:~elopio/canonical-identity-provider/django-cancel_addition
Reviewer Review Type Date Requested Status
Canonical ISD hackers Pending
Review via email: mp+164419@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Hi! I'm doing some cleanup on SSO MPs, I assume this is no longer valid, will set as Rejected.

Please shange the global status if this is still current. Thanks!

Unmerged revisions

861. By Leo Arias

Changed the default device test from SST to django.

860. By Leo Arias

Merged with trunk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'acceptance/tests/devices/test_add_device.py'
2--- acceptance/tests/devices/test_add_device.py 2013-05-02 17:20:14 +0000
3+++ acceptance/tests/devices/test_add_device.py 2013-05-17 14:58:36 +0000
4@@ -28,11 +28,6 @@
5 your_authentication_devices = self.page.cancel()
6 self.assertEqual(your_authentication_devices.get_devices(), [])
7
8- def test_default_device(self):
9- self.assertEqual(
10- self.page.get_selected_device(),
11- 'type_google')
12-
13 @unittest.skipIf('paper_device' not in sst.config.flags,
14 'Paper device is not enabled.')
15 def test_paper_device_enabled(self):
16
17=== modified file 'webui/tests/test_devices.py'
18--- webui/tests/test_devices.py 2013-05-15 07:25:13 +0000
19+++ webui/tests/test_devices.py 2013-05-17 14:58:36 +0000
20@@ -115,15 +115,17 @@
21 twofactor_switch.patch()
22 self.addCleanup(twofactor_switch.unpatch)
23
24- def get_device_types(self):
25+ def test_default_device(self):
26+ device_radios = self._get_device_radios()
27+ selected_radios = [radio for radio in device_radios if radio.checked]
28+ self.assertEqual(len(selected_radios), 1)
29+ self.assertEqual(selected_radios[0].value, 'google')
30+
31+ def _get_device_radios(self):
32 response = self.client.get(reverse('device-addition'))
33 self.assertEqual(response.status_code, 200)
34-
35 tree = PyQuery(response.content)
36- nodes = tree.find('input[type="radio"]')
37-
38- device_types = [dict(node.items())['value'] for node in nodes]
39- return device_types
40+ return tree.find('input[type="radio"]')
41
42 def test_paper_device_flag_in_template_user_in_team(self):
43 email = EmailAddress.objects.get(email=self.login_email)
44@@ -132,6 +134,11 @@
45 device_types = self.get_device_types()
46 self.assertIn('paper', device_types)
47
48+ def get_device_types(self):
49+ nodes = self._get_device_radios()
50+ device_types = [dict(node.items())['value'] for node in nodes]
51+ return device_types
52+
53 def test_paper_device_flag_in_template_user_not_in_team(self):
54 device_types = self.get_device_types()
55 self.assertNotIn('paper', device_types)