Example #1
0
 def test_api_db_sync_has_active_member_permissions(self):
     request = self.factory.get(API_BASE + 'db-sync', format='json')
     force_authenticate(request, user=self.user)
     response = api_views.DatabaseSyncListView(request)
     assert response.data
     project_data = response.data['results'][0]
     assert 'active_member_permissions' in project_data
Example #2
0
 def test_api_db_sync_has_the_test_project(self):
     request = self.factory.get(API_BASE + 'db-sync', format='json')
     force_authenticate(request, user=self.user)
     response = api_views.DatabaseSyncListView(request)
     project_names = [
         project['name'] for project in response.data['results']
     ]
     assert PROJECT_NAME in project_names
Example #3
0
 def test_api_db_sync_has_all_projects(self):
     request = self.factory.get(API_BASE + 'db-sync', format='json')
     force_authenticate(request, user=self.user)
     response = api_views.DatabaseSyncListView(request)
     self.assertEqual(Project.objects.count(),
                      len(response.data['results']))
Example #4
0
 def test_api_db_sync(self):
     request = self.factory.get(API_BASE + 'db-sync', format='json')
     force_authenticate(request, user=self.user)
     response = api_views.DatabaseSyncListView(request)
     self.assertEqual(status.HTTP_200_OK, response.status_code)
Example #5
0
 def test_api_needs_authentication(self):
     request = self.factory.get(API_BASE, format='json')
     response = api_views.DatabaseSyncListView(request)
     self.assertEqual(status.HTTP_401_UNAUTHORIZED, response.status_code)
Example #6
0
 def test_api_db_sync_has_environment(self):
     request = self.factory.get(API_BASE + 'db-sync', format='json')
     force_authenticate(request, user=self.user)
     response = api_views.DatabaseSyncListView(request)
     project_data = response.data['results'][0]
     assert 'environment' in project_data