mise a jour tests + images de test
@ -126,7 +126,7 @@ class AddLogoForm(FlaskForm):
|
|||||||
validators.Length(
|
validators.Length(
|
||||||
max=20, message="Un nom ne doit pas dépasser 20 caractères"
|
max=20, message="Un nom ne doit pas dépasser 20 caractères"
|
||||||
),
|
),
|
||||||
validators.required("Nom de logo requis (alphanumériques ou '-')"),
|
validators.DataRequired("Nom de logo requis (alphanumériques ou '-')"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
upload = FileField(
|
upload = FileField(
|
||||||
@ -136,7 +136,7 @@ class AddLogoForm(FlaskForm):
|
|||||||
scu.LOGOS_IMAGES_ALLOWED_TYPES,
|
scu.LOGOS_IMAGES_ALLOWED_TYPES,
|
||||||
f"n'accepte que les fichiers image {', '.join(scu.LOGOS_IMAGES_ALLOWED_TYPES)}",
|
f"n'accepte que les fichiers image {', '.join(scu.LOGOS_IMAGES_ALLOWED_TYPES)}",
|
||||||
),
|
),
|
||||||
validators.required("Fichier image manquant"),
|
validators.DataRequired("Fichier image manquant"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
do_insert = SubmitField("ajouter une image")
|
do_insert = SubmitField("ajouter une image")
|
||||||
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.0 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
@ -133,8 +133,8 @@ def test_get_jpg_data(create_dept, create_logos):
|
|||||||
assert logo.logoname == "A"
|
assert logo.logoname == "A"
|
||||||
assert logo.suffix == "jpg"
|
assert logo.suffix == "jpg"
|
||||||
assert logo.filename == "A.jpg"
|
assert logo.filename == "A.jpg"
|
||||||
assert logo.size == (140, 121)
|
assert logo.size == (224, 131)
|
||||||
assert logo.mm == approx((5.74, 4.96), 0.1)
|
assert logo.mm == approx((9.38, 5.49), 0.1)
|
||||||
|
|
||||||
|
|
||||||
def test_get_png_without_data(create_dept, create_logos):
|
def test_get_png_without_data(create_dept, create_logos):
|
||||||
@ -144,7 +144,7 @@ def test_get_png_without_data(create_dept, create_logos):
|
|||||||
assert logo.logoname == "D"
|
assert logo.logoname == "D"
|
||||||
assert logo.suffix == "png"
|
assert logo.suffix == "png"
|
||||||
assert logo.filename == "D.png"
|
assert logo.filename == "D.png"
|
||||||
assert logo.size == (121, 121)
|
assert logo.size == (140, 131)
|
||||||
assert logo.density is None
|
assert logo.density is None
|
||||||
assert logo.mm is None
|
assert logo.mm is None
|
||||||
|
|
||||||
|