Development #46237
tests tipi: la refdet est en UTC
Début:
01 septembre 2020
Echéance:
% réalisé:
0%
Temps estimé:
Patch proposed:
Oui
Planning:
Non
Description
Quand on dort pas et qu'on lancer un tox sur eopayment à 1h du matin à Paris :
def test_tipi_no_orderid_no_refdet(): p = eopayment.Payment('tipi', {'numcli': '12345'}) payment_id, kind, url = p.request( amount=Decimal('123.12'), exer=9999, email='info@entrouvert.com', saisie='T') assert eopayment.tipi.Payment.REFDET_RE.match(payment_id) is not None parsed_qs = parse_qs(urlparse(url).query) assert 'objet' not in parsed_qs assert parsed_qs['montant'] == ['12312'] assert parsed_qs['saisie'] == ['T'] assert parsed_qs['mel'] == ['info@entrouvert.com'] assert parsed_qs['numcli'] == ['12345'] assert parsed_qs['exer'] == ['9999'] > assert parsed_qs['refdet'][0].startswith(datetime.datetime.now().strftime('%Y%m%d')) E AssertionError: assert False E + where False = <built-in method startswith of str object at 0x7f3e5b20b800>('20200901') E + where <built-in method startswith of str object at 0x7f3e5b20b800> = '202008312245350546503812'.startswith E + and '20200901' = <built-in method strftime of datetime.datetime object at 0x7f3e5b19b6c0>('%Y%m%d') E + where <built-in method strftime of datetime.datetime object at 0x7f3e5b19b6c0> = datetime.datetime(2020, 9, 1, 0, 45, 35, 382853).strftime E + where datetime.datetime(2020, 9, 1, 0, 45, 35, 382853) = <built-in method now of type object at 0x8ed860>() E + where <built-in method now of type object at 0x8ed860> = <class 'datetime.datetime'>.now E + where <class 'datetime.datetime'> = datetime.datetime
Il faut utiliser datetime.datetime.utcnow
Fichiers
Révisions associées
Historique
Mis à jour par Thomas Noël il y a plus de 3 ans
- Fichier 0001-tests-use-utcnow-in-TIPI-refdet-verifications-46237.patch 0001-tests-use-utcnow-in-TIPI-refdet-verifications-46237.patch ajouté
- Statut changé de Nouveau à Solution proposée
- Patch proposed changé de Non à Oui
Mis à jour par Benjamin Dauvergne il y a plus de 3 ans
Faudrait corriger le build d'abord.
Ensuite je verrai plutôt une modification pour utiliser une date timezone='Europe/Paris', en attendant de générer des refdet corrects.
Mis à jour par Benjamin Dauvergne il y a plus de 3 ans
- Sujet changé de tests tipi: la refget est en UTC à tests tipi: la refdet est en UTC
Mis à jour par Benjamin Dauvergne il y a plus de 3 ans
- Statut changé de Solution proposée à En cours
Mis à jour par Benjamin Dauvergne il y a plus de 3 ans
- Fichier 0001-tipi-use-Paris-timezone-for-generating-refdet-46237.patch 0001-tipi-use-Paris-timezone-for-generating-refdet-46237.patch ajouté
- Tracker changé de Bug à Development
- Statut changé de En cours à Solution proposée
Mis à jour par Serghei Mihai il y a plus de 3 ans
- Statut changé de Solution proposée à Solution validée
Mis à jour par Benjamin Dauvergne il y a plus de 3 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit 3ac360abe836b204051b18c5192e2a880bb3404b Author: Benjamin Dauvergne <bdauvergne@entrouvert.com> Date: Sun Oct 11 09:35:50 2020 +0200 tipi: use Paris timezone for generating refdet (#46237)
Mis à jour par Frédéric Péters il y a plus de 3 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tipi: use Paris timezone for generating refdet (#46237)