cubicweb/web/test/test_jscript.py
author Sylvain Thénault <sylvain.thenault@logilab.fr>
Thu, 24 Nov 2016 15:36:26 +0100
changeset 11892 08cf02efc7ce
parent 11850 87443f279b0f
permissions -rw-r--r--
Simplify and fix _cw.drop_entity_cache * it's never called with an eid as argument, beside in a useless case in test (removed) * the only place where it's called from outside the tests is in full-text reindexation in server.checkintegrity: we could removed the request implementation and move it in unittest_rset, byt I decided to keep it for consistency with all other entity cache handling methods * get back a fix from Julien Cristau for the connection's implementation, quoting is commit message: When removing an entity from the transaction's cache, clear the entity's own cache May avoid issues where an entity object is still accessible somewhere else (e.g. an operation) after dropping it from the transaction's cache, with a stale attribute or relation cache.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11850
87443f279b0f [devtools] Make timeout error in qunit tests configurable and use SkipTest in test_jscript.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11057
diff changeset
     1
from unittest import SkipTest
87443f279b0f [devtools] Make timeout error in qunit tests configurable and use SkipTest in test_jscript.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11057
diff changeset
     2
10887
a0315e9f4c20 [tests] Don't import QUnitTestCase into tests' global namespace
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10583
diff changeset
     3
from cubicweb.devtools import qunit
5743
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     4
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     5
from os import path as osp
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     6
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     7
10887
a0315e9f4c20 [tests] Don't import QUnitTestCase into tests' global namespace
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10583
diff changeset
     8
class JScript(qunit.QUnitTestCase):
5743
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
     9
11850
87443f279b0f [devtools] Make timeout error in qunit tests configurable and use SkipTest in test_jscript.py
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 11057
diff changeset
    10
    timeout_error = SkipTest
5743
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    11
    all_js_tests = (
10935
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    12
        ("/static/jstests/test_utils.js", (
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    13
            "/data/cubicweb.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    14
            "/data/cubicweb.compat.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    15
            "/data/cubicweb.python.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    16
            "/static/jstests/utils.js",
5766
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    17
            ),
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    18
         ),
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    19
10935
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    20
        ("/static/jstests/test_htmlhelpers.js", (
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    21
            "/data/cubicweb.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    22
            "/data/cubicweb.compat.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    23
            "/data/cubicweb.python.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    24
            "/data/cubicweb.htmlhelpers.js",
5766
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    25
            ),
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    26
         ),
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    27
10935
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    28
        ("/static/jstests/test_ajax.js", (
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    29
            "/data/cubicweb.python.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    30
            "/data/cubicweb.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    31
            "/data/cubicweb.compat.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    32
            "/data/cubicweb.htmlhelpers.js",
049209b9e9d6 [qunit] stop dealing with filesystem paths
Rémi Cardona <remi.cardona@logilab.fr>, Julien Cristau <julien.cristau@logilab.fr>
parents: 10887
diff changeset
    33
            "/data/cubicweb.ajax.js",
5766
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    34
            ),
c397819f2482 [js tests] fix javascripts tests definition, test_datetime.js now included in test_utils.js, which test other stuff as well
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents: 5743
diff changeset
    35
         ),
5743
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    36
    )
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    37
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    38
4a0600664f85 Use the qunit automatic launcher for existing testcase.
Pierre-Yves David <pierre-yves.david@logilab.fr>
parents:
diff changeset
    39
if __name__ == '__main__':
10887
a0315e9f4c20 [tests] Don't import QUnitTestCase into tests' global namespace
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10583
diff changeset
    40
    from unittest import main
a0315e9f4c20 [tests] Don't import QUnitTestCase into tests' global namespace
Rémi Cardona <remi.cardona@logilab.fr>
parents: 10583
diff changeset
    41
    main()