1. 26 May, 2021 1 commit
  2. 07 Jul, 2021 2 commits
  3. 30 Jun, 2021 1 commit
  4. 09 Jun, 2021 2 commits
  5. 16 Jun, 2021 1 commit
  6. 07 Oct, 2020 2 commits
  7. 08 May, 2020 2 commits
    • Simon Chabot's avatar
      fix(tests): test_chmod checks whether the permissions are the same as the source file · 527d2989602e
      Simon Chabot authored
      test_chmod used to check that permission are 644, but this is not what is done
      in the `process_resource` method. This function sets the permissions to the same
      as the source file.
      
      As a consequence, depending on your configuration (default umask for instance),
      you may end up with the expected 644 permissions or… something else. (666 on our
      gitlab-runner for instance).
      
      To make the test consistent with what is done in the function, and consistent
      with the initial purpose of this test [0], let's simply check that the
      permissions of the source file and the compiled file are the same.
      
      If it appears that this is not enough, a solution could be to enforce 644
      permissions in the `process_resource` method, or give the expected permissions
      through parameters.
      
      [0]: https://www.cubicweb.org/ticket/17143773
      527d2989602e
    • Simon Chabot's avatar
      fix(tests): test_chmod checks whether the permissions are the same as the source file · 8b49be4828fc
      Simon Chabot authored
      test_chmod used to check that permission are 644, but this is not what is done
      in the `process_resource` method. This function sets the permissions to the same
      as the source file.
      
      As a consequence, depending on your configuration (default umask for instance),
      you may end up with the expected 644 permissions or… something else. (666 on our
      gitlab-runner for instance).
      
      To make the test consistent with what is done in the function, and consistent
      with the initial purpose of this test [0], let's simply check that the
      permissions of the source file and the compiled file are the same.
      
      If it appears that this is not enough, a solution could be to enforce 644
      permissions in the `process_resource` method, or give the expected permissions
      through parameters.
      
      [0]: https://www.cubicweb.org/ticket/17143773
      
      --HG--
      branch : 3.27
      8b49be4828fc
  8. 11 Apr, 2020 2 commits
  9. 28 May, 2021 1 commit
  10. 04 Jun, 2021 1 commit
  11. 26 May, 2021 1 commit
  12. 27 Jun, 2019 1 commit
    • Denis Laxalde's avatar
      [autoform] Fix display_fields handling · 9f03df82f8de
      Denis Laxalde authored
      This follows-up on changeset b2ceb483e056 (present in 3.25 as well), in
      which AutomaticEntityForm.editable_attributes() was turned into a
      generator. In this method, in case display_fields is not None, we
      previously returned a list of (rtype, role); this was changed into a
      yield, but the change was missing a return after the loop in order not
      to go through the remainder of the function.
      
      Add tests for editable_attributes() method.
      
      --HG--
      branch : 3.26
      9f03df82f8de
  13. 08 Feb, 2020 1 commit
  14. 29 Oct, 2018 1 commit
    • Philippe Pepiot's avatar
      Fix flake8 issues since release 3.6.0 · 2fcb53ee5178
      Philippe Pepiot authored
      Flake8 had a new release which raise new issues, namely:
      
      W504: line break after binary operator
      F841: local variable 'ex' is assigned to but never used
      W605: invalid escape sequence
      F821: undefined name 'buffer' (noqa seems the only way to avoid this false positive)
      
      Also pin flake8>=3.6 in our tests and make explicit that we use python3 to run
      flake8 tests.
      
      --HG--
      branch : 3.26
      2fcb53ee5178
  15. 11 Jun, 2018 1 commit
    • Denis Laxalde's avatar
      [test] Update webconfig's tests accounting for cubicweb-file being now a package · 8b3f1d1f0939
      Denis Laxalde authored
      WebconfigTC.test_locate_all_files and WebconfigTC.test_locate_resource
      assumed that cubicweb-file was installed in <share>/cubes/file whereas,
      from the latest release, it is now a standard Python package thus
      installed in site-packages as cubicweb_file. We simply update base
      directory of these two tests.
      
      --HG--
      branch : 3.26
      8b3f1d1f0939
  16. 28 Jun, 2018 2 commits
    • Denis Laxalde's avatar
      [py3] Use "utf-8" as input encoding for docutils in rest extension · 04ff0d3ef1d3
      Denis Laxalde authored
      Docutils says that "unicode" is an unknown encoding on Python3. Not sure
      where "unicode" as an encoding comes (it's there since showtime) but
      "utf-8" seems more appropriate.
      
      From now on, rendering of CubicWeb's rst directive (e.g. ..winclude)
      works on Python 3. Accordingly, we extend wdoc's test to demonstrate
      this. For this we need to install docutils in tox's web environment.
      
      --HG--
      branch : 3.26
      04ff0d3ef1d3
    • Denis Laxalde's avatar
      [test] Add a trivial test for "wdoc" view · ec2ab8dc93a2
      Denis Laxalde authored
      We just make sure it gets rendered without errors (which wasn't the case
      before the previous patch).
      
      It does not work on Python 3; this will be fixed in next changeset.
      
      --HG--
      branch : 3.26
      ec2ab8dc93a2
  17. 24 Jul, 2019 1 commit
  18. 16 May, 2019 1 commit
  19. 12 Apr, 2019 1 commit
    • Laurent Peuch's avatar
      Use secure hash algorithm in WebConfiguration.sign_text · 6eba53763482
      Laurent Peuch authored
      Fix: PendingDeprecationWarning: HMAC() without an explicit digestmod argument is deprecated.
      
      The default hash algorithm used by hmac.new is md5. As of today, md5 is so weak
      that it's the equivalent of plaintext and can't be considered to be secured at all.
      Therefor, we switch to a secure hash algorithm.
      
      The rational for choosing sha3_512 is:
      * the recommended algorithm is at least sha_256
      * the stronger, the more secured and sha3_512 is the stronger available
      * thinking about the future this should keep this part of the code safe long
        enough before people think about checking it again
      
      You can read more about choosing a secure hash algorithm in the NIST
      recommendations https://csrc.nist.gov/Projects/Hash-Functions/NIST-Policy-on-Hash-Functions
      
      This code modification should normally be transparent since check_text_sign is
      exactly this code 'self.sign_text(text) == signature' and that sign_text is
      only used in combination with it. The only impact is that the hash is going to
      move from 32 char to 128 which might make html page a bit bigger and that
      sha3_512 is slow to compute (which is a good thing for security)
      6eba53763482
  20. 05 Apr, 2019 1 commit
    • Denis Laxalde's avatar
      Drop python2 support · 26744ad37953
      Denis Laxalde authored
      This mostly consists in removing the dependency on "six" and updating
      the code to use only Python3 idioms.
      
      Notice that we previously used TemporaryDirectory from
      cubicweb.devtools.testlib for compatibility with Python2. We now
      directly import it from tempfile.
      26744ad37953
  21. 21 Mar, 2019 1 commit
    • Denis Laxalde's avatar
      Remove Twisted web server · 9d88e1177c35
      Denis Laxalde authored
      Twisted web server is not used anymore and has been superseded by
      pyramid many years ago. Furthermore, our usage is not compatible with
      Python 3. So we drop the "etwist" sub-package.
      
      As a consequence, "all-in-one" configuration type gets dropped as it was
      Twisted-specific. We resurrect it in cubicweb/pyramid/config.py by only
      keeping options used by the "pyramid". Similarly, we introduce a
      AllInOneCreateHandler in cubicweb/pyramid/pyramidctl.py that is
      basically the one that lived in cubicweb/etwist/twctl.py and is used to
      create the "all-in-one" instance. Added a TODO here about "pyramid.ini"
      that could be generated at the end of bootstrap() method.
      
      In cubicweb/devtools/httptest.py, CubicWebServerTC is now equivalent to
      CubicWebWsgiTC and the latter is dropped.
      9d88e1177c35
  22. 19 Mar, 2019 1 commit
    • Philippe Pepiot's avatar
      [web/test] drop dependency on third party cubes · aff5d3498f68
      Philippe Pepiot authored
      Drop dependency on cubicweb-file, cubicweb-blog and cubicweb-tag for cubicweb/web/test
      Copy required parts of cubes (schema, entities, views and hooks) into
      cubicweb/web/test/data/cubicweb-<cube> that make tests pass.
      aff5d3498f68
  23. 14 Mar, 2019 1 commit
    • Denis Laxalde's avatar
      Drop most deprecated code in cubicweb.web · b01dd0ef43aa
      Denis Laxalde authored
      This includes both Python and JavaScript code. Most code has been
      deprecated since a very long time (versions 3.1x mostly, more than 5
      years ago, and a few things until 3.24).
      
      There are still a few deprecated things, most of which are actually used
      within cubicweb (or in cubes we depend on for tests). I don't know what
      to do with these...
      
      Removed a couple of unused imports along the way.
      
      Changelog entry will come in a later changeset.
      b01dd0ef43aa
  24. 29 Oct, 2018 1 commit
    • Philippe Pepiot's avatar
      Fix flake8 issues since release 3.6.0 · c703dc95c82e
      Philippe Pepiot authored
      Flake8 had a new release which raise new issues, namely:
      
      W504: line break after binary operator
      F841: local variable 'ex' is assigned to but never used
      W605: invalid escape sequence
      F821: undefined name 'buffer' (noqa seems the only way to avoid this false positive)
      
      Also pin flake8>=3.6 in our tests and make explicit that we use python3 to run
      flake8 tests.
      c703dc95c82e
  25. 11 Jun, 2018 1 commit
  26. 19 Apr, 2018 2 commits
  27. 15 Feb, 2018 2 commits
    • Denis Laxalde's avatar
      [config] Avoid relying on shared_dir method when possible · d84bc85f7f70
      Denis Laxalde authored
      From 3.26, some "data" directories (like web/data and i18n or wdoc) are
      installed along with CubicWeb in site packages. So we can retrieve them
      relatively to the module that needs them (namely "cubicweb" for "i18n"
      and "cubicweb.web" for "web/data" and "wdoc"). Reason for doing this is
      that "share_dir()" is not working when cubicweb is installed in
      "develop" mode and we are about to drop this method.
      
      Related to #17132990.
      
      --HG--
      branch : 3.26
      d84bc85f7f70
    • Denis Laxalde's avatar
      [test] Add a test for WebConfiguration.locate_all_files() · 4ec56c0bcc5c
      Denis Laxalde authored
      We are going to change the implementation, make sure there's no
      regression.
      
      --HG--
      branch : 3.26
      4ec56c0bcc5c
  28. 06 Oct, 2017 3 commits
    • Sylvain Thénault's avatar
      [uicfg] Fix autoform_section rtags wrt derivation · 1d7e4f98f902
      Sylvain Thénault authored
      cw 3.25 introduced the 'derived rtags' feature, but missed that
      `autoform_section` implementation was overriding several methods where this was
      implemented in the base class. The following problems are tested and fixed:
      
      * during init, we should not attempt to call `_initfunc_step2` if there is some
        parent,
      
      * but we should handle expansion of wildcard ('*' used as subject or object of a
        tag) since this is handled during init step for this class, unlike others
        which handle this in `get` method (i.e. at lookup time),
      
      * fix overrided `get` method to consider parent rtag if any.
      
      Closes #17107020
      
      --HG--
      branch : 3.25
      1d7e4f98f902
    • Sylvain Thénault's avatar
      [web/test] Use bare unittest main instead of lgc.main · 1a5911825ef5
      Sylvain Thénault authored
      --HG--
      branch : 3.25
      1a5911825ef5
    • Sylvain Thénault's avatar
      [cleanup] Fix some flake8 errors · 3fa6c9ef2f51
      Sylvain Thénault authored
      and drop upper bound of copyright along the way.
      
      autoform module is not added to flake8-ok-files since there are some remaining
      errors to be handled, but that's still a start.
      
      --HG--
      branch : 3.25
      3fa6c9ef2f51
  29. 19 Jun, 2017 1 commit
  30. 12 Apr, 2017 1 commit