Projet

Général

Profil

Bug #89318

test_fields.py::test_page en erreur

Ajouté par Yann Weber il y a 21 jours. Mis à jour il y a 18 jours.

Statut:
Solution déployée
Priorité:
Normal
Assigné à:
Version cible:
-
Début:
09 avril 2024
Echéance:
% réalisé:

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

Visiblement il manque la fixture pub au test, il part en erreur quand il est le premier de son module à être lancé.

Révisions associées

Révision eb862fc7 (diff)
Ajouté par Yann Weber il y a 21 jours

tests: add missing fixture to test_fields tests (#89318)

Historique

#1

Mis à jour par Robot Gitea il y a 21 jours

  • Statut changé de Nouveau à En cours
  • Assigné à mis à Yann Weber

Yann Weber (yweber) a ouvert une pull request sur Gitea concernant cette demande :

#2

Mis à jour par Robot Gitea il y a 21 jours

Frédéric Péters (fpeters) a relu et demandé des modifications sur une pull request sur Gitea concernant cette demande :

#3

Mis à jour par Frédéric Péters il y a 21 jours

il part en erreur

C'est intéressant de la noter dans le ticket.

#4

Mis à jour par Yann Weber il y a 21 jours

  • Assigné à changé de Yann Weber à Benjamin Dauvergne

Frédéric Péters a écrit :

C'est intéressant de la noter dans le ticket.

En effet !

FAILED tests/test_fields.py::test_page - AttributeError: 'NoneType' object has no attribute 'error_context'

    def test_page():
        formdef = FormDef()
        formdef.fields = []
        page = fields.PageField()
>       assert page.is_visible({}, formdef) is True

tests/test_fields.py:331: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
wcs/fields/base.py:614: in is_visible
    return self.evaluate_condition(
wcs/fields/base.py:608: in evaluate_condition
    return PageCondition(condition, {'dict_vars': dict_vars, 'formdef': formdef}, record_errors).evaluate(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <PageCondition (None) None>, source_label = 'Field: ', source_url = ''

    def evaluate(self, source_label=None, source_url=None):
>       with get_publisher().error_context(
            condition=self.value, condition_type=self.type, source_label=source_label, source_url=source_url
        ):
E       AttributeError: 'NoneType' object has no attribute 'error_context'

wcs/conditions.py:53: AttributeError
#5

Mis à jour par Yann Weber il y a 21 jours

Robot Gitea a écrit :

Frédéric Péters (fpeters) a relu et demandé des modifications sur une pull request sur Gitea concernant cette demande :

Suite à ton commentaire j'ai lancé tox -e py3-django32-codestyle-coverage -- tests/test_fields.py -n 38 : il y a 38 tests, j'imagine que du coup il attribuera 1 test par worker et que de cette manière je peux détecter les tests à qui il manquerait la/une fixture ?

FAILED tests/test_fields.py::test_date - AttributeError: 'NoneType' object has no attribute 'current_language'
FAILED tests/test_fields.py::test_page - AttributeError: 'NoneType' object has no attribute 'error_context'
FAILED tests/test_fields.py::test_file_convert_from_anything - AttributeError: 'NoneType' object has no attribute 'app_dir'
FAILED tests/test_fields.py::test_item_render - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_item_render_as_autocomplete - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_item_radio_lengths - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_add_to_form - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_items_render - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_item_render_as_radio - AttributeError: '_thread._local' object has no attribute 'publisher'
FAILED tests/test_fields.py::test_bool_stats - AttributeError: 'NoneType' object has no attribute 'cfg'
 10 failed, 28 passed, 122 warnings in 7.11s 
#6

Mis à jour par Robot Gitea il y a 21 jours

  • Statut changé de En cours à Solution proposée
#7

Mis à jour par Robot Gitea il y a 21 jours

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

Frédéric Péters (fpeters) a approuvé une pull request sur Gitea concernant cette demande :

#8

Mis à jour par Frédéric Péters il y a 21 jours

  • Assigné à changé de Benjamin Dauvergne à Yann Weber
#9

Mis à jour par Robot Gitea il y a 18 jours

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

Frédéric Péters (fpeters) a mergé une pull request sur Gitea concernant cette demande :

#10

Mis à jour par Transition automatique il y a 18 jours

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

Formats disponibles : Atom PDF