Projet

Général

Profil

Development #51624

EmailValidator et test mal écrit

Ajouté par Valentin Deniaud il y a environ 3 ans. Mis à jour il y a environ 3 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
03 mars 2021
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Oui
Planning:
Non

Description

Dans test_validators.py,

 60 @pytest.mark.parametrize('email', ['ok@ok.com', 'a|b@ok.com', 'a/..b@ok.com'])
 61 def test_email_validator_ok(email):
 62     EmailValidator()('ok@ok.com')

Et forcément quand on corrige on s'aperçoit que le test ne passe pas pour ''... C'est grave docteur ?


Fichiers

Révisions associées

Révision 4484b7ce (diff)
Ajouté par Valentin Deniaud il y a environ 3 ans

tests: fix faulty email validator test (#51624)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 3 ans

Non a priori c'est le test qui est faut (c'est surtout pour documenter ce qu'accepte le validateur de Django ou pas). On a rajouté cette contrainte, mais j'ai oublié pourquoi :

    LOCALPART_FORBIDDEN_RE = re.compile(r'^(?:[./|]|.*[@%!`#&?]|.*/\.\./)')

#2

Mis à jour par Valentin Deniaud il y a environ 3 ans

  • Assigné à mis à Valentin Deniaud
#3

Mis à jour par Valentin Deniaud il y a environ 3 ans

#4

Mis à jour par Paul Marillonnet il y a environ 3 ans

  • Statut changé de Solution proposée à Solution validée

Ok.

#5

Mis à jour par Valentin Deniaud il y a environ 3 ans

  • Statut changé de Solution validée à Résolu (à déployer)
commit 4484b7cea85de85b693eb09c242205b979fdba2b
Author: Valentin Deniaud <vdeniaud@entrouvert.com>
Date:   Thu Mar 4 14:58:39 2021 +0100

    tests: fix faulty email validator test (#51624)
#6

Mis à jour par Frédéric Péters il y a environ 3 ans

  • Statut changé de Résolu (à déployer) à Solution déployée

Formats disponibles : Atom PDF