def test_show_integrations(self): request = self.factory.get('/acquisition_counter/') request.user = self.user response = views.integrations(request) self.assertEqual(response.status_code, 200)
def test_create_integration(self): idProject = Project.objects.filter(name='test')[0].id request = self.factory.post('/integrations/', {'user': self.user, 'tool': 0, 'project': idProject, 'url': '-', 'username': '******', 'password': 0, 'query': '-'}) request.user = self.user response = views.integrations(request) integrations = len(Integration.objects.all()) self.assertEqual(integrations, 2)