Skip to content

Commit

Permalink
chore: minor update to let Mauritz work on it
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolan committed Mar 27, 2025
1 parent fe407a6 commit 91fc8da
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions backend/tests/test_workout_file_upload.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
import os
from users.models import User
from rest_framework.test import APIClient
from django.core.files.uploadedfile import SimpleUploadedFile
from django.test import TestCase
from myapp.models import WorkoutFile # Replace with the actual model import
from workouts.models import WorkoutFile # Replace with the actual model import
from django.urls import reverse
from django.contrib.auth import get_user_model



class TestWorkoutFileUpload(TestCase):
def setUp(self):
self.url = reverse('workout-file-list') # Use 'workout-file-list' from urls.py
self.user = User.objects.create_user(
username='testuser', password='password'
)
self.client.login(username='testuser', password='password')
self.client = APIClient()
self.user = get_user_model().objects.create_user(username=os.getenv("DJANGO_SUPERUSER_USERNAME"), password=os.getenv("DJANGO_SUPERUSER_PASSWORD"))
self.client.force_authenticate(self.user)

self.url = reverse("workout-file-list")

def test_upload_multiple_valid_pdf_files(self):
print(self.client.get(self.url).status_code)
# Create mock PDF files under 2MB
files = {}
for i in range(8): # 8 files
Expand Down

0 comments on commit 91fc8da

Please sign in to comment.