From 2b7d9dbac2f0e4cc7c94f76397604983b0bda9aa Mon Sep 17 00:00:00 2001 From: CodingGirlGargi Date: Mon, 24 Mar 2025 17:49:52 +0100 Subject: [PATCH] preserve local changes after resetting to main --- backend/requirements.txt | 2 +- backend/tests/__init__.py | 1 + backend/tests/test_template.py | 14 ++++++++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 backend/tests/__init__.py diff --git a/backend/requirements.txt b/backend/requirements.txt index 346da44..a5f8dc8 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -28,7 +28,7 @@ six==1.16.0 sqlparse==0.5.1 typing_extensions==4.12.2 tzdata==2024.1 -urllib3==2.2.2 +urllib3>=1.25.4,<1.27 validators==0.33.0 win32-setctime==1.1.0 djangorestframework-simplejwt==5.3.1 diff --git a/backend/tests/__init__.py b/backend/tests/__init__.py new file mode 100644 index 0000000..8d86e63 --- /dev/null +++ b/backend/tests/__init__.py @@ -0,0 +1 @@ +#Marks this folder as a python project \ No newline at end of file diff --git a/backend/tests/test_template.py b/backend/tests/test_template.py index 4a3dda4..b430877 100644 --- a/backend/tests/test_template.py +++ b/backend/tests/test_template.py @@ -1,5 +1,15 @@ -from django.test import TestCase +''' +#This is for coverage testing independent of manage.py +import os +import django +import sys +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'secfit.settings') +django.setup() +''' + from workouts.models import Exercise +from django.test import TestCase class User(TestCase): @@ -11,6 +21,6 @@ def setUp(self): def test_user_has_coach(self): all_exercises = Exercise.objects.all() num_reps = Exercise.objects.filter(unit="reps") - self.assertEqual(len(all_exercises), 3) self.assertEqual(len(num_reps), 2) +