Merge pull request #4054 from normanjaeckel/FixTest

Fixed Test
This commit is contained in:
Finn Stutzenstein 2018-12-13 08:19:57 +01:00 committed by GitHub
commit e21668bd62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -633,11 +633,10 @@ class ManageMultipleSubmitters(TestCase):
text='test_text_kg39KFGm,ao)22FK9lLu') text='test_text_kg39KFGm,ao)22FK9lLu')
self.motion2.save() self.motion2.save()
@pytest.mark.skip(reason="This throws an json validation error I'm not sure about")
def test_set_submitters(self): def test_set_submitters(self):
response = self.client.post( response = self.client.post(
reverse('motion-manage-multiple-submitters'), reverse('motion-manage-multiple-submitters'),
{ json.dumps({
'motions': [ 'motions': [
{ {
'id': self.motion1.id, 'id': self.motion1.id,
@ -652,14 +651,15 @@ class ManageMultipleSubmitters(TestCase):
] ]
} }
] ]
}) }),
print(response.data['detail']) content_type='application/json'
)
self.assertEqual(response.status_code, 200) self.assertEqual(response.status_code, 200)
self.assertEqual(self.motion1.submitters.count(), 1) self.assertEqual(self.motion1.submitters.count(), 1)
self.assertEqual(self.motion2.submitters.count(), 1) self.assertEqual(self.motion2.submitters.count(), 1)
self.assertEqual( self.assertEqual(
self.motion1.submitters.get().pk, self.motion1.submitters.get().user.pk,
self.motion2.submitters.get().pk) self.motion2.submitters.get().user.pk)
def test_non_existing_user(self): def test_non_existing_user(self):
response = self.client.post( response = self.client.post(