Project

General

Profile

Bug #99141

test_formdef_import.py::test_custom_views_pickle_mode dépend de l'existence d'une base local pour l'utilisateur en cours

Added by Benjamin Dauvergne 14 days ago. Updated 10 days ago.

Status:
Solution déployée
Priority:
Bas
Target version:
-
Start date:
28 November 2024
Due date:
% Done:

0%

Estimated time:
Patch proposed:
No
Planning:
No

Description

$ dropdb bdauvergne
$ nox -R -s "tests(django='>=3.2,<3.3')" -- tests -vvv --lf -k pickle_mode
nox > Running session tests(django='>=3.2,<3.3')
nox > Re-using existing virtual environment at .nox/tests-django-3-2-3-3.
nox > /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/lib/python3.11/site-packages/lasso.py => /usr/lib/python3/dist-packages/lasso.py
nox > /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/lib/python3.11/site-packages/_lasso.cpython-311-x86_64-linux-gnu.so => /usr/lib/python3/dist-packages/_lasso.cpython-311-x86_64-linux-gnu.so
nox > python manage.py compilemessages
nox > py.test --dist loadfile tests/test_formdef_import.py -vvv -k pickle_mode tests/
================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.11.2, pytest-8.3.3, pluggy-1.5.0 -- /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/bin/python
cachedir: .pytest_cache
django: version: 3.2.25, settings: wcs.settings (from env)
rootdir: /home/bdauvergne/wd/eo/wcs
plugins: xdist-3.6.1, django-4.9.0, cov-6.0.0, pytest_freezer-0.4.8
collected 48 items / 47 deselected / 1 selected                                                                                                                                                                                                                                          

tests/test_formdef_import.py::test_custom_views_pickle_mode FAILED                                                                                                                                                                                                                 [100%]

======================================================================================================================================== FAILURES ========================================================================================================================================
_____________________________________________________________________________________________________________________________ test_custom_views_pickle_mode ______________________________________________________________________________________________________________________________

    def test_custom_views_pickle_mode():
        pub = create_temporary_pub(pickle_mode=True)

        formdef = FormDef()
        formdef.name = 'foo'
        formdef.fields = [
            fields.StringField(id='1', label='Foo', varname='foo'),
            fields.StringField(id='2', label='Bar', varname='bar'),
        ]
>       formdef.store()

tests/test_formdef_import.py:1032: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
wcs/formdef.py:533: in store
    StorableObject.store(self, **kwargs)
wcs/qommon/storage.py:901: in store
    self.id = self.get_new_id(create=True)
wcs/formdef.py:425: in get_new_id
    id = cls.get_sql_new_id(id_start=int(id))
wcs/formdef.py:440: in get_sql_new_id
    return sql.get_formdef_new_id(id_start=id_start)
wcs/sql.py:381: in get_formdef_new_id
    _, cur = get_connection_and_cursor()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

new = False

    def get_connection_and_cursor(new=False):
        conn = get_connection(new=new)
        try:
>           cur = conn.cursor()
E           AttributeError: 'NoneType' object has no attribute 'cursor'

wcs/sql.py:337: AttributeError
$ sudo -u postgres createdb -Obdauvergne bdauvergne
$ nox -R -s "tests(django='>=3.2,<3.3')" -- tests/test_formdef_import.py -vvv -k pickle_mode
nox > Running session tests(django='>=3.2,<3.3')
nox > Re-using existing virtual environment at .nox/tests-django-3-2-3-3.
nox > /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/lib/python3.11/site-packages/lasso.py => /usr/lib/python3/dist-packages/lasso.py
nox > /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/lib/python3.11/site-packages/_lasso.cpython-311-x86_64-linux-gnu.so => /usr/lib/python3/dist-packages/_lasso.cpython-311-x86_64-linux-gnu.so
nox > python manage.py compilemessages
nox > py.test --dist loadfile tests/test_formdef_import.py -vvv -k pickle_mode tests/
================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.11.2, pytest-8.3.3, pluggy-1.5.0 -- /home/bdauvergne/wd/eo/wcs/.nox/tests-django-3-2-3-3/bin/python
cachedir: .pytest_cache
django: version: 3.2.25, settings: wcs.settings (from env)
rootdir: /home/bdauvergne/wd/eo/wcs
plugins: xdist-3.6.1, django-4.9.0, cov-6.0.0, pytest_freezer-0.4.8
collected 48 items / 47 deselected / 1 selected                                                                                                                                                                                                                                          

tests/test_formdef_import.py::test_custom_views_pickle_mode PASSED                                                                                                                                                                                                                 [100%]

Associated revisions

Revision 73392244 (diff)
Added by Frédéric Péters 10 days ago

tests: remove all pickle mode tests (#99141)

History

#1

Updated by Robot Gitea 10 days ago

  • Status changed from Nouveau to En cours
  • Assignee set to Frédéric Péters

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

#2

Updated by Robot Gitea 10 days ago

  • Status changed from En cours to Solution proposée
#3

Updated by Robot Gitea 10 days ago

  • Status changed from Solution proposée to Solution validée

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

#4

Updated by Robot Gitea 10 days ago

  • Status changed from Solution validée to Résolu (à déployer)

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

#5

Updated by Transition automatique 10 days ago

  • Status changed from Résolu (à déployer) to Solution déployée

Also available in: Atom PDF