From 3328c6af3ba4d568d5e34e8ab60a5e0c26cb5773 Mon Sep 17 00:00:00 2001 From: emaric Date: Wed, 24 Jan 2024 12:31:43 +0100 Subject: [PATCH] sve radi --- .../__pycache__/tests.cpython-38.pyc | Bin 2682 -> 2682 bytes plovidba_aplikacija/tests.py | 57 --------------- user/__init__.py | 0 user/__pycache__/tests.cpython-38.pyc | Bin 162 -> 2696 bytes user/tests.py | 66 +----------------- 5 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 user/__init__.py diff --git a/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc b/plovidba_aplikacija/__pycache__/tests.cpython-38.pyc index 3cd87f9f075d4cd7bc67b5bcb7275fd52398671e..70954d9dbe7dafd8aa10e944e5387ed1cdaff3c5 100644 GIT binary patch delta 106 zcmew*@=Js-l$V!_0SIo?u1jrV-^f?Y#K=9liK&Z`YcenMK}O-t=b5`08O0_?u{JXb zZNA6q!N{mIS)Khdqt@o%?3|2@dXrf>+ZYum_i$d7WCWU1EC3{U7~zmbfJ1;E0Pp!1 A!T62MG+ZdxJ_i$d7v;vw_EC3{U7~zmbfJ1;E0BL#} A0{{R3 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 c3823b23234a4e3a6c6a5a700a6d26c41638d5a9..d12056321937beb0dc6815864a6adccc45393171 100644 GIT binary patch literal 2696 zcmcgu&2Jk;6yMoz+uI}!EtET<#<{F4jW(W1>dmg#of#+8 za!>8G{{e^egnU8#J#*#6zW^8BTYuDX6R0?Jt$p*}%A|y%$zkV*ZX%F8m3ajWW@GolCV5Ne;Xx_z@R5>q-@=u7t_b+M|b)J*Ez} z#X;0=^&-{E+S=ZgTr^SD^kaf>A6|J62sc8)jL>9+nJx&WX$X*MRD17Z?D$N>jT$W`Gevt#?rYN=w<4>wt{ij#94OE*Mx@=`G-v z`~2r9?Ie7;nWX|P3(d+(+0j03%C|c_jarE=?ze{bE7h_uTsTa7*N@}+$c%-nV#wM4CD(f^lNp{p?dr>2O#@j~|k#w+UvkTq>K}Y zb8O~Ov@pd$vSX)3nDxqhj%&t=+b6Hdb67d?`ey8_LR@@pVx8<51G^TM&~VCl!WGwM z=MW%q504{pAj>5HGHC${dT~D!O-`e(dIDmriQpoB0*xAiYqpqnM`}udF&ApR_FpA^Xg>3w@X{Qsiqy~IM?L{Arxl#$#*fZTyn`tfAEOi4FvM3#R*+PYU<9Wk zpXUHJV}Z>U{=FG80OFheW#5IL=X?1|tsLkQi=n);Wpq{GzoN+uba|P#KRpM%UeSF4 zR=}-%IBI>TCx;3gP%yl$mca)O3h>e&UhinjSw?FA-q7Fg@V`=?h=Ccv?GTU!>mSGP Bp|b!0 delta 95 zcmeAWUBu`d%FD~e00g&V)}{IbS&u;+WWWgIH~?`m3y?@*2xib^^jpbL1QLc4lczKJ U3US!v=BJeAq}qWbJ_9iW0J9Gc^8f$< 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