Merge lp:~canonical-isd-hackers/canonical-identity-provider/add-2f-to-account-admin-test-fixes into lp:canonical-identity-provider/release

Proposed by Stuart Metcalfe
Status: Merged
Approved by: Simon Davy
Approved revision: no longer in the source branch.
Merged at revision: 328
Proposed branch: lp:~canonical-isd-hackers/canonical-identity-provider/add-2f-to-account-admin-test-fixes
Merge into: lp:canonical-identity-provider/release
Diff against target: 58 lines (+11/-5)
2 files modified
identityprovider/templates/account/edit.html (+1/-1)
identityprovider/tests/unit/test_admin.py (+10/-4)
To merge this branch: bzr merge lp:~canonical-isd-hackers/canonical-identity-provider/add-2f-to-account-admin-test-fixes
Reviewer Review Type Date Requested Status
Canonical ISD hackers Pending
Review via email: mp+92460@code.launchpad.net

Commit message

Fixes broken admin test (typo and forgot import) - oops

Description of the change

Fixes broken admin test (typo and forgot import) - oops

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/templates/account/edit.html'
2--- identityprovider/templates/account/edit.html 2011-09-15 21:02:31 +0000
3+++ identityprovider/templates/account/edit.html 2012-02-10 13:45:22 +0000
4@@ -65,7 +65,7 @@
5
6 {% block content %}
7 <form action="+edit" method="post" class="shortfields">
8- {% csrf_token %}
9+ {% csrf_token %}
10 <div id="col1">
11 <p {% if form.displayname.errors %}class="haserrors"{% endif %}>
12 <label class="formLabel" for="id_displayname">{% trans "Full name" %}</label>
13
14=== modified file 'identityprovider/tests/unit/test_admin.py'
15--- identityprovider/tests/unit/test_admin.py 2012-02-10 12:04:42 +0000
16+++ identityprovider/tests/unit/test_admin.py 2012-02-10 13:45:22 +0000
17@@ -8,7 +8,7 @@
18 from pyquery import PyQuery
19
20 from identityprovider.admin import (AccountPasswordInline,
21- EmailAddressInline)
22+ AuthenticationDeviceInline, EmailAddressInline)
23 from identityprovider.models import (EmailAddress,
24 OpenIDRPConfig, APIUser, Person)
25 from identityprovider.models.account import (Account, AccountPassword,
26@@ -68,7 +68,7 @@
27
28 def test_inline_models(self):
29 expected_inlines = [AccountPasswordInline, EmailAddressInline,
30- AuthenticationDevicesInline]
31+ AuthenticationDeviceInline]
32 registered_inlines = admin.site._registry[Account].inlines
33 self.assertEqual(registered_inlines, expected_inlines)
34
35@@ -100,7 +100,10 @@
36 'emailaddress_set-0-id': str(email.id),
37 'emailaddress_set-0-account': str(account.id),
38 'emailaddress_set-0-email': new_email,
39- 'emailaddress_set-0-status': str(email.status)})
40+ 'emailaddress_set-0-status': str(email.status),
41+ 'devices-TOTAL_FORMS': '0',
42+ 'devices-INITIAL_FORMS': '0',
43+ })
44 # Any non-error status code would be fine here, but right now
45 # it redirects with a 302.
46 self.assertEqual(r.status_code, 302)
47@@ -132,7 +135,10 @@
48 'emailaddress_set-0-status': str(email.status),
49 'emailaddress_set-1-account': str(account.id),
50 'emailaddress_set-1-email': 'failure@example.com',
51- 'emailaddress_set-1-status': str(email.status)})
52+ 'emailaddress_set-1-status': str(email.status),
53+ 'devices-TOTAL_FORMS': '0',
54+ 'devices-INITIAL_FORMS': '0',
55+ })
56 account = Account.objects.get(pk=1)
57 self.assertContains(r, 'Only one email address can be preferred.')
58 self.assertEqual(len(account.emailaddress_set.filter(