fix tests

new behavior introduced in 82aba755b8
This commit is contained in:
Élie Bouttier 2016-07-23 13:00:11 +02:00
parent 8385a9501a
commit 7c43d693fe

View File

@ -55,11 +55,12 @@ class AccountTests(TestCase):
b.save() b.save()
p = Participation.objects.get(user=b) p = Participation.objects.get(user=b)
self.assertFalse(p.orga) self.assertFalse(p.orga)
self.assertEqual(self.client.get(reverse('list-participant')).status_code, 200) self.assertEqual(self.client.get(reverse('list-participant')).status_code, 403)
# login signal should set orga to True due to superuser status # login signal should set orga to True due to superuser status
self.client.login(username='b', password='b') self.client.login(username='b', password='b')
p = Participation.objects.get(user=b) p = Participation.objects.get(user=b)
self.assertTrue(p.orga) self.assertTrue(p.orga)
self.assertEqual(self.client.get(reverse('list-participant')).status_code, 200)
self.assertEqual(self.client.post(reverse('edit-participant', kwargs={'username': 'a'}), self.assertEqual(self.client.post(reverse('edit-participant', kwargs={'username': 'a'}),
{'biography': 'foo', 'nootes': 'bar'}).status_code, 200) {'biography': 'foo', 'nootes': 'bar'}).status_code, 200)
self.assertEqual(User.objects.get(username='a').profile.biography, '') self.assertEqual(User.objects.get(username='a').profile.biography, '')