Parcourir la source

Remove duplicate code in tests

iso-functional commit
Jocelyn Delalande il y a 7 ans
Parent
commit
0019e280ed
1 fichiers modifiés avec 3 ajouts et 24 suppressions
  1. 3 24
      wifiwithme/apps/contribmap/tests.py

+ 3 - 24
wifiwithme/apps/contribmap/tests.py

@@ -206,30 +206,9 @@ class TestForms(TestCase):
 
 
     @override_settings(NOTIFICATION_EMAILS=['foo@example.com'])
     @override_settings(NOTIFICATION_EMAILS=['foo@example.com'])
     def test_add_contrib_like_a_robot(self):
     def test_add_contrib_like_a_robot(self):
-        response = self.client.post('/map/contribute', {
-            'roof': True,
-            'human_field': 'should not have no value',
-            'privacy_place_details': True,
-            'privacy_coordinates': True,
-            'phone': '0202020202',
-            'orientations': 'N',
-            'orientations': 'NO',
-            'orientations': 'O',
-            'orientations': 'SO',
-            'orientations': 'S',
-            'orientations': 'SE',
-            'orientations': 'E',
-            'orientations': 'NE',
-            'orientation': 'all',
-            'name': 'JohnCleese',
-            'longitude': -1.553621,
-            'latitude': 47.218371,
-            'floor_total': '2',
-            'floor': 1,
-            'email': 'coucou@example.com',
-            'contrib_type': 'connect',
-            'connect_local': 'on',
-        })
+        robot_data = self.valid_data.copy()
+        robot_data['human_field'] = 'should contain no value'
+        response = self.client.post('/map/contribute', robot_data)
         self.assertEqual(response.status_code, 403)
         self.assertEqual(response.status_code, 403)
         self.assertEqual(len(mail.outbox), 0)
         self.assertEqual(len(mail.outbox), 0)