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
=== modified file 'identityprovider/templates/account/edit.html'
--- identityprovider/templates/account/edit.html 2011-09-15 21:02:31 +0000
+++ identityprovider/templates/account/edit.html 2012-02-10 13:45:22 +0000
@@ -65,7 +65,7 @@
6565
66{% block content %}66{% block content %}
67<form action="+edit" method="post" class="shortfields">67<form action="+edit" method="post" class="shortfields">
68 {% csrf_token %}68 {% csrf_token %}
69 <div id="col1">69 <div id="col1">
70 <p {% if form.displayname.errors %}class="haserrors"{% endif %}>70 <p {% if form.displayname.errors %}class="haserrors"{% endif %}>
71 <label class="formLabel" for="id_displayname">{% trans "Full name" %}</label>71 <label class="formLabel" for="id_displayname">{% trans "Full name" %}</label>
7272
=== modified file 'identityprovider/tests/unit/test_admin.py'
--- identityprovider/tests/unit/test_admin.py 2012-02-10 12:04:42 +0000
+++ identityprovider/tests/unit/test_admin.py 2012-02-10 13:45:22 +0000
@@ -8,7 +8,7 @@
8from pyquery import PyQuery8from pyquery import PyQuery
99
10from identityprovider.admin import (AccountPasswordInline,10from identityprovider.admin import (AccountPasswordInline,
11 EmailAddressInline)11 AuthenticationDeviceInline, EmailAddressInline)
12from identityprovider.models import (EmailAddress,12from identityprovider.models import (EmailAddress,
13 OpenIDRPConfig, APIUser, Person)13 OpenIDRPConfig, APIUser, Person)
14from identityprovider.models.account import (Account, AccountPassword,14from identityprovider.models.account import (Account, AccountPassword,
@@ -68,7 +68,7 @@
6868
69 def test_inline_models(self):69 def test_inline_models(self):
70 expected_inlines = [AccountPasswordInline, EmailAddressInline,70 expected_inlines = [AccountPasswordInline, EmailAddressInline,
71 AuthenticationDevicesInline]71 AuthenticationDeviceInline]
72 registered_inlines = admin.site._registry[Account].inlines72 registered_inlines = admin.site._registry[Account].inlines
73 self.assertEqual(registered_inlines, expected_inlines)73 self.assertEqual(registered_inlines, expected_inlines)
7474
@@ -100,7 +100,10 @@
100 'emailaddress_set-0-id': str(email.id),100 'emailaddress_set-0-id': str(email.id),
101 'emailaddress_set-0-account': str(account.id),101 'emailaddress_set-0-account': str(account.id),
102 'emailaddress_set-0-email': new_email,102 'emailaddress_set-0-email': new_email,
103 'emailaddress_set-0-status': str(email.status)})103 'emailaddress_set-0-status': str(email.status),
104 'devices-TOTAL_FORMS': '0',
105 'devices-INITIAL_FORMS': '0',
106 })
104 # Any non-error status code would be fine here, but right now107 # Any non-error status code would be fine here, but right now
105 # it redirects with a 302.108 # it redirects with a 302.
106 self.assertEqual(r.status_code, 302)109 self.assertEqual(r.status_code, 302)
@@ -132,7 +135,10 @@
132 'emailaddress_set-0-status': str(email.status),135 'emailaddress_set-0-status': str(email.status),
133 'emailaddress_set-1-account': str(account.id),136 'emailaddress_set-1-account': str(account.id),
134 'emailaddress_set-1-email': 'failure@example.com',137 'emailaddress_set-1-email': 'failure@example.com',
135 'emailaddress_set-1-status': str(email.status)})138 'emailaddress_set-1-status': str(email.status),
139 'devices-TOTAL_FORMS': '0',
140 'devices-INITIAL_FORMS': '0',
141 })
136 account = Account.objects.get(pk=1)142 account = Account.objects.get(pk=1)
137 self.assertContains(r, 'Only one email address can be preferred.')143 self.assertContains(r, 'Only one email address can be preferred.')
138 self.assertEqual(len(account.emailaddress_set.filter(144 self.assertEqual(len(account.emailaddress_set.filter(