This commit is contained in:
Chris Van 2011-12-09 21:01:00 -08:00
Родитель bf2b68582c
Коммит 5c22312016
1 изменённых файлов: 15 добавлений и 13 удалений

Просмотреть файл

@ -152,7 +152,6 @@ class TestUserDeleteForm(UserFormBase):
class TestUserEditForm(UserFormBase):
fixtures = ['users/test_backends', 'base/users']
def setUp(self):
super(TestUserEditForm, self).setUp()
@ -189,18 +188,6 @@ class TestUserEditForm(UserFormBase):
self.assertFormError(r, 'form', 'password2',
'The passwords did not match.')
def test_admin_correct_delete_link(self):
self.client.logout()
assert self.client.login(username='admin@mozilla.com',
password='password')
user = UserProfile.objects.all()[0]
r = self.client.get(reverse('users.admin_edit', args=[user.id]))
doc = pq(r.content)
eq_(doc('a.delete').attr('href'),
reverse('admin:users_userprofile_delete', args=[user.id]))
def test_set_new_passwords(self):
data = {'username': 'jbalogh',
'email': 'jbalogh@mozilla.com',
@ -238,6 +225,21 @@ class TestUserEditForm(UserFormBase):
assert update_mock.called
class TestAdminUserEditForm(UserFormBase):
fixtures = ['base/users']
def setUp(self):
super(TestAdminUserEditForm, self).setUp()
self.client.login(username='admin@mozilla.com', password='password')
self.url = reverse('users.admin_edit', args=[self.user.id])
def test_delete_link(self):
r = self.client.get(self.url)
eq_(r.status_code, 200)
eq_(pq(r.content)('a.delete').attr('href'),
reverse('admin:users_userprofile_delete', args=[self.user.id]))
class TestUserLoginForm(UserFormBase):
def _get_login_url(self):