added geo support to track_user view
This commit is contained in:
@@ -65,7 +65,7 @@ class TrackUserViewTest(APITestCase):
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_anon_user_can_register_product_action(self):
|
||||
"""Not logged-in user cannot modify existing instance
|
||||
"""Not logged-in user can register product action
|
||||
"""
|
||||
# Create instance
|
||||
product = ProductFactory()
|
||||
@@ -85,7 +85,7 @@ class TrackUserViewTest(APITestCase):
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_anon_user_can_register_company_action(self):
|
||||
"""Not logged-in user cannot modify existing instance
|
||||
"""Not logged-in user can register company action
|
||||
"""
|
||||
# Create instance
|
||||
company = CompanyFactory()
|
||||
@@ -104,6 +104,27 @@ class TrackUserViewTest(APITestCase):
|
||||
# Assert forbidden code
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
def test_anon_user_can_register_company_with_coordinates(self):
|
||||
"""Not logged-in user can register action with coordinates
|
||||
"""
|
||||
# Create instance
|
||||
company = CompanyFactory()
|
||||
|
||||
data = {
|
||||
'action': 'VIEW',
|
||||
'action_object': {
|
||||
'model': 'company',
|
||||
'id': company.id,
|
||||
},
|
||||
'geo': (12.2, -0.545)
|
||||
}
|
||||
|
||||
# Query endpoint
|
||||
response = self.client.post(self.endpoint, data=data, format='json')
|
||||
|
||||
# Assert forbidden code
|
||||
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
|
||||
|
||||
# authenticated user
|
||||
def test_auth_user_can_only_post(self):
|
||||
"""Regular logged-in user can list instance
|
||||
|
||||
Reference in New Issue
Block a user