Projet

Général

Profil

Bug #87741

avec ADMIN_FOR_ALL, échec s'il existe un FormDef

Ajouté par Lauréline Guérin il y a environ 2 mois. Mis à jour il y a environ 2 mois.

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

0%

Temps estimé:
Patch proposed:
Non
Planning:
Non

Description

    def test_admin_for_all(pub):
        user = create_superuser(pub)
        role = create_role(pub)

        try:
            with open(os.path.join(pub.app_dir, 'ADMIN_FOR_ALL'), 'w'):
                pass  # create empty file
            resp = get_app(pub).get('/backoffice/')
            assert resp.location.endswith('studio/')
            resp = resp.follow()
            # check there is a CSS class
            assert resp.pyquery.find('body.admin-for-all')

            # check there are menu items
>           resp.click('Forms', index=0)

tests/admin_pages/test_all.py:99: 

....

    @register.filter
    def get_preference(user, pref_name):
>       return user.get_preference(pref_name)
E       AttributeError: 'NoneType' object has no attribute 'get_preference'

wcs/qommon/templatetags/qommon.py:1284: AttributeError

Reproductible en lançant pytest tests/test_workflow_tests.py tests/admin_pages/test_all.py::test_admin_for_all

En ajoutant un FormDef.wipe() en début de test_admin_for_all, ça passe

Révisions associées

Révision 2eb29089 (diff)
Ajouté par Frédéric Péters il y a environ 2 mois

templatetags: make sure |get_preference gets a user (#87741)

Historique

#1

Mis à jour par Robot Gitea il y a environ 2 mois

  • Statut changé de Nouveau à En cours
  • Assigné à mis à Frédéric Péters

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

#2

Mis à jour par Robot Gitea il y a environ 2 mois

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

Mis à jour par Robot Gitea il y a environ 2 mois

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

Lauréline Guérin (lguerin) a approuvé une pull request sur Gitea concernant cette demande :

#4

Mis à jour par Robot Gitea il y a environ 2 mois

  • 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 :

#5

Mis à jour par Transition automatique il y a environ 2 mois

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

Formats disponibles : Atom PDF