Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Automatic linting

Github-actionsbf443da7f5a9
diff --git a/wger/gallery/forms.py b/wger/gallery/forms.py
index 8f6b0069a..f7bfbaf91 100644
--- a/wger/gallery/forms.py
+++ b/wger/gallery/forms.py
@@ -1,20 +1,26 @@
+# Standard Library
+from datetime import (
+ date,
+ datetime,
+)
+
# Django
from django.forms import (
DateField,
ModelForm,
widgets,
)
-
from django.utils.translation import gettext_lazy
+# Third Party
+# Python Imaging Library to extract data
+from PIL import Image as PilImage
+
# wger
from wger.gallery.models import Image
from wger.utils.constants import DATE_FORMATS
from wger.utils.widgets import Html5DateInput
-# Python Imaging Library to extract data
-from PIL import Image as PilImage
-from datetime import datetime, date
class ImageForm(ModelForm):
def __init__(self, *args, **kwargs):
@@ -26,7 +32,7 @@ class ImageForm(ModelForm):
input_formats=DATE_FORMATS,
widget=Html5DateInput(),
required=False,
- help_text=gettext_lazy("If date is left empty, it will be read from the image instead"),
+ help_text=gettext_lazy('If date is left empty, it will be read from the image instead'),
)
class Meta:
diff --git a/wger/gallery/tests/test_gallery_image.py b/wger/gallery/tests/test_gallery_image.py
index 3fbf3fdf8..520cf1aa4 100644
--- a/wger/gallery/tests/test_gallery_image.py
+++ b/wger/gallery/tests/test_gallery_image.py
@@ -38,6 +38,7 @@ class AddGalleryImageTestCase(WgerAddTestCase):
'image': open('wger/exercises/tests/protestschwein.jpg', 'rb'),
}
+
class AddGalleryImageNoDateEXIFTestCase(WgerAddTestCase):
"""
Tests adding an image to the gallery with no date, should read EXIF data
@@ -57,6 +58,7 @@ class AddGalleryImageNoDateEXIFTestCase(WgerAddTestCase):
image = Image.objects.filter(description='EXIF Read').first()
self.assertEqual(image.date, datetime.date(2026, 3, 1))
+
class AddGalleryImageNoDateTestCase(WgerAddTestCase):
"""
Tests adding an image to the gallery with no date, should default to current date
@@ -76,6 +78,7 @@ class AddGalleryImageNoDateTestCase(WgerAddTestCase):
image = Image.objects.filter(description='No date provided').first()
self.assertEqual(image.date, datetime.date.today())
+
class DeleteGalleryImageTestCase(WgerDeleteTestCase):
"""
Tests deleting a gallery image