Skip to content

Commit

Permalink
feat: add pytest configuration and media handling - Added pytest.ini …
Browse files Browse the repository at this point in the history
…for coverage reporting, created media directory for file uploads, updated comment views for better error handling
  • Loading branch information
haahauge committed Apr 3, 2025
1 parent 160bb6d commit fc19dd9
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/comments/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CommentList(
mixins.ListModelMixin, mixins.CreateModelMixin, generics.GenericAPIView
):
serializer_class = CommentSerializer
permission_classes = [permissions.IsAuthenticated]
permission_classes = [permissions.IsAuthenticated & IsCommentVisibleToUser]
filter_backends = [OrderingFilter]
ordering_fields = ["timestamp"]

Expand Down
1 change: 1 addition & 0 deletions backend/media/workouts/1/large.txt

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions backend/media/workouts/1/test.exe
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test content
1 change: 1 addition & 0 deletions backend/media/workouts/1/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test content
1 change: 1 addition & 0 deletions backend/media/workouts/1/test_S4tabw9.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test content
1 change: 1 addition & 0 deletions backend/media/workouts/1/test_byECvg1.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test content
4 changes: 4 additions & 0 deletions backend/pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[pytest]
DJANGO_SETTINGS_MODULE = secfit.settings
python_files = tests.py test_*.py *_tests.py
addopts = --cov=. --cov-report=term-missing --cov-report=html

0 comments on commit fc19dd9

Please sign in to comment.