-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DONE] Bugfixes & improvements - 3.5.0 (#1023)
* Fix dashboard styles * Fix dashboard translation * Modify Twitter icon & improve chapter style * Fix plural translations & z-index * Improve accessibility * Fix channels & some improvements * Fix dressing form * Fix roles optgroup * Update Pillow & sorl-thumbnail * Add some unit tests
- Loading branch information
1 parent
b229dad
commit 9e5068a
Showing
35 changed files
with
505 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
from django.test import TestCase | ||
from pod.cut.utils import clean_database | ||
from pod.video.models import Notes, AdvancedNotes, Type, Video | ||
from pod.chapter.models import Chapter | ||
from pod.completion.models import Overlay, Track | ||
from django.contrib.auth.models import User | ||
|
||
|
||
class CleanDatabaseTest(TestCase): | ||
fixtures = ["initial_data.json"] | ||
|
||
def setUp(self): | ||
self.user = User.objects.create(username="pod", password="pod1234pod") | ||
self.video = Video.objects.create( | ||
title="Video1", | ||
owner=self.user, | ||
video="test.mp4", | ||
is_draft=False, | ||
type=Type.objects.get(id=1), | ||
) | ||
self.chapter = Chapter.objects.create(video=self.video, title="Chapter 1") | ||
self.advanced_notes = AdvancedNotes.objects.create( | ||
video=self.video, | ||
user=self.user, | ||
note="Advanced note content" | ||
) | ||
self.notes = Notes.objects.create( | ||
video=self.video, user=self.user, note="Note content") | ||
self.overlay = Overlay.objects.create(video=self.video, title="Overlay 1") | ||
self.track = Track.objects.create(video=self.video) | ||
|
||
def test_clean_database(self): | ||
"""Test if clean_database works correctly.""" | ||
# Check if the models exist before cleaning | ||
self.assertTrue(Chapter.objects.filter(video=self.video).exists()) | ||
self.assertTrue(AdvancedNotes.objects.filter(video=self.video).exists()) | ||
self.assertTrue(Notes.objects.filter(video=self.video).exists()) | ||
self.assertTrue(Overlay.objects.filter(video=self.video).exists()) | ||
self.assertTrue(Track.objects.filter(video=self.video).exists()) | ||
|
||
# Call clean_database | ||
clean_database(self.video) | ||
|
||
# Check if the models are deleted after cleaning | ||
self.assertFalse(Chapter.objects.filter(video=self.video).exists()) | ||
self.assertFalse(AdvancedNotes.objects.filter(video=self.video).exists()) | ||
self.assertFalse(Notes.objects.filter(video=self.video).exists()) | ||
self.assertFalse(Overlay.objects.filter(video=self.video).exists()) | ||
self.assertFalse(Track.objects.filter(video=self.video).exists()) | ||
|
||
print(" ---> test_clean_database ok") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
"""Unit tests for Esup-Pod dressing views.""" | ||
|
||
from django.contrib.auth.models import User | ||
from django.test import TestCase | ||
|
||
from pod.dressing.models import Dressing | ||
|
||
from pod.video.models import Type, Video | ||
|
||
|
||
class VideoDressingViewTest(TestCase): | ||
"""Dressing page test case.""" | ||
|
||
fixtures = ["initial_data.json"] | ||
|
||
def setUp(self) -> None: | ||
self.user = User.objects.create_user(username='user', password='password', is_staff=1) | ||
self.first_video = Video.objects.create( | ||
title="First video", | ||
slug="first-video", | ||
owner=self.user, | ||
video="first_video.mp4", | ||
is_draft=False, | ||
type=Type.objects.get(id=1), | ||
) | ||
self.dressing = Dressing.objects.create(title='Test Dressing') | ||
self.dressing.owners.set([self.user]) | ||
self.dressing.users.set([self.user]) | ||
|
||
def test_video_dressing_view(self): | ||
"""Test for video_dressing view.""" | ||
|
||
print(" ---> test_video_dressing_view: OK! --- VideoDressingViewTest") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.