diff --git a/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc b/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc index 3cd87f9..70954d9 100644 Binary files a/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc and b/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc differ diff --git a/plovidba_aplikacija/tests.py b/plovidba_aplikacija/tests.py index aa75fe5..d574362 100644 --- a/plovidba_aplikacija/tests.py +++ b/plovidba_aplikacija/tests.py @@ -1,60 +1,3 @@ -# from django.test import TestCase -# from django.contrib.gis.geos import Point -# from django.urls import reverse -# from rest_framework import status -# from rest_framework.test import APITestCase -# from plovidba_aplikacija.models import ObjektSigurnosti - - -# # Testiranje listanja objekata -# class ObjektSigurnostiListTest(APITestCase): -# def test_list_objekti_sigurnosti(self): -# url = reverse('objektisigurnosti-list') -# response = self.client.get(url) - -# self.assertEqual(response.status_code, status.HTTP_200_OK) - -# # Testiranje stvaranja objekata -# class ObjektSigurnostiCreateTest(APITestCase): -# def setUp(self): -# self.url = reverse('objektisigurnosti-list') - -# def test_create_objekt_sigurnosti(self): -# data = { -# 'lokacija': {'lat': 45.123, 'lon': 18.456}, -# 'naziv': 'test-naziv', -# } -# response = self.client.post(self.url, data, format='json') -# self.assertEqual(response.status_code, status.HTTP_201_CREATED) -# self.assertTrue(ObjektSigurnosti.objects.filter(naziv='test-naziv').exists()) - - -# # Testiranje dohvaćanja pojedinog objekata -# class ObjektSigurnostiDetailTest(APITestCase): -# def setUp(self): -# self.objekt = ObjektSigurnosti.objects.create( -# lokacija=Point(18.456, 45.123), -# naziv='test-naziv', -# ) -# self.url = reverse('objektisigurnosti-detail', args=[self.objekt.pk]) - - -# def test_get_objekt_sigurnosti(self): -# response = self.client.get(self.url) -# self.assertEqual(response.status_code, status.HTTP_200_OK) - -# def test_update_objekt_sigurnosti(self): -# data = { -# 'lokacija': {'type': 'Point', 'coordinates': [45.123,18.456]}, -# 'naziv' : 'updated-naziv', - -# } -# response = self.client.patch(self.url, data, format='json') -# self.assertEqual(response.status_code, status.HTTP_200_OK) - - - - from django.test import TestCase from django.contrib.gis.geos import Point from django.urls import reverse diff --git a/user/__init__.py b/user/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/user/__pycache__/tests.cpython-38.pyc b/user/__pycache__/tests.cpython-38.pyc index c3823b2..d120563 100644 Binary files a/user/__pycache__/tests.cpython-38.pyc and b/user/__pycache__/tests.cpython-38.pyc differ diff --git a/user/tests.py b/user/tests.py index 21d258e..c2629a3 100644 --- a/user/tests.py +++ b/user/tests.py @@ -1,65 +1,3 @@ -# from django.test import TestCase +from django.test import TestCase -# from django.urls import reverse -# from rest_framework import status -# from rest_framework.test import APITestCase -# from user.models import Organization, User -# from user.views import user_delete, change_password - - - -# class UserApiTestCase(APITestCase): - -# def setUp(self): - -# self.organization = Organization.objects.create(name="test organization") - -# self.user01 = User.objects.create( -# username="user01", -# email="test@example.com", -# first_name="User", -# last_name="01", -# organization=self.organization -# ) -# self.user01.set_password('test1234') - -# self.user02 = User.objects.create( -# username="user02", -# email="test02@example.com", -# first_name="User", -# last_name="02", -# organization=self.organization -# ) - -# def test_user_delete_forbidden(self): -# self.client.force_authenticate(self.user02) -# url = reverse("user_delete", kwargs={"pk": self.user01.id}) -# response = self.client.delete(url) -# self.assertEqual(response.status_code, status.HTTP_403_FORBIDDEN) - -# def test_user_delete_success(self): -# self.client.force_authenticate(self.user01) -# url = reverse("user_delete", kwargs={"pk": self.user01.id}) -# response = self.client.delete(url) -# self.assertEqual(response.status_code, status.HTTP_204_NO_CONTENT) - -# def test_user_password_change_bad_request(self): -# self.client.force_authenticate(self.user01) -# url = reverse("change_password") -# data = {'old_password': 'wrong-paasword', 'new_password': 'pass1234'} -# response = self.client.put(url, data=data) -# self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - -# def test_user_password_change_too_comon(self): -# self.client.force_authenticate(self.user01) -# url = reverse("change_password") -# data = {'old_password': 'test1234', 'new_password': 'pass1234'} -# response = self.client.put(url, data=data) -# self.assertEqual(response.status_code, status.HTTP_400_BAD_REQUEST) - -# def test_user_password_change_success(self): -# self.client.force_authenticate(self.user01) -# url = reverse("change_password") -# data = {'old_password': 'test1234', 'new_password': 'listlabs12'} -# response = self.client.put(url, data=data) -# self.assertEqual(response.status_code, status.HTTP_200_OK) +# Create your tests here. \ No newline at end of file