Parcourir la source

Fix broken tests

Jocelyn Delande il y a 9 ans
Parent
commit
7c71221ed0
1 fichiers modifiés avec 14 ajouts et 2 suppressions
  1. 14 2
      wifiwithme/apps/contribmap/tests.py

+ 14 - 2
wifiwithme/apps/contribmap/tests.py

@@ -26,7 +26,9 @@ class APITestCase(TestCase):
 class TestContrib(TestCase):
     def test_comma_separatedcharfield(self):
         co = Contrib(name='foo', orientations=['SO', 'NE'],
-                     contrib_type=Contrib.CONTRIB_CONNECT)
+                     contrib_type=Contrib.CONTRIB_CONNECT,
+                     latitude=0.5, longitude=0.5,
+)
         co.save()
         self.assertEqual(
             Contrib.objects.get(name='foo').orientations,
@@ -41,6 +43,8 @@ class TestContribPrivacy(TestCase):
             name='John',
             phone='010101010101',
             contrib_type=Contrib.CONTRIB_CONNECT,
+            latitude=0.5,
+            longitude=0.5,
         )
         self.assertEqual(c.get_public_field('phone'), None)
 
@@ -50,6 +54,8 @@ class TestContribPrivacy(TestCase):
             phone='010101010101',
             contrib_type=Contrib.CONTRIB_CONNECT,
             privacy_name=True,
+            latitude=0.5,
+            longitude=0.5,
         )
         self.assertEqual(c.get_public_field('name'), 'John')
 
@@ -60,6 +66,8 @@ class TestContribPrivacy(TestCase):
             orientations=['N'],
             contrib_type=Contrib.CONTRIB_CONNECT,
             privacy_name=True,
+            latitude=0.5,
+            longitude=0.5,
         )
         self.assertEqual(c.get_public_field('angles'), [[-23, 22]])
 
@@ -68,6 +76,8 @@ class TestContribPrivacy(TestCase):
             name='John',
             phone='010101010101',
             contrib_type=Contrib.CONTRIB_CONNECT,
+            latitude=0.5,
+            longitude=0.5,
         )
         self.assertEqual(c.privacy_name, False)
         self.assertEqual(c.get_public_field('name'), None)
@@ -83,7 +93,9 @@ class TestViews(APITestCase):
             name='John',
             phone='010101010101',
             contrib_type=Contrib.CONTRIB_CONNECT,
-            privacy_coordinates=False,
+            privacy_coordinates=True,
+            latitude=0.5,
+            longitude=0.5,
         )
         response = self.client.json_get('/map/public.json')
         self.assertEqual(response.status_code, 200)