1. 24 Jan, 2018 4 commits
  2. 12 Jan, 2018 3 commits
  3. 12 Dec, 2017 1 commit
    • Denis Laxalde's avatar
      [pyramid] Let logging be configured through .ini file · cd760c411242
      Denis Laxalde authored
      We do not initialize logging in CubicWebPyramidConfiguration thus
      preventing logging to be started with cubicweb's configuration. On the
      other hand, any logging configuration defined in ``development.ini``
      file will be loaded by whatever start the instance using this file (i.e.
      pserve, gunicorn, etc.). The benefit is that logging can now be
      configured per "qualified name" in this file (i.e. one can easily set
      the DEBUG level for the application cube while keeping all dependencies'
      level to WARNING). In the development.ini template, we add logger
      configurations for "logilab" and "cubicweb" qualified names (along with
      those of the application cube).
      cd760c411242
  4. 01 Dec, 2017 2 commits
    • Denis Laxalde's avatar
      Disable pytest's logs reporting · 6a71cb23f827
      Denis Laxalde authored
      CubicWeb already prints captured logs in stderr upon test failure, so we
      get them twice. Until we fix our logging management, disabling pytest
      capture and restore brings the output level back to sanity.
      6a71cb23f827
    • Denis Laxalde's avatar
      [pyramid] Do not issue security warnings in test mode · a46fb3f58ea2
      Denis Laxalde authored
      When some session or authtk secret is missing in Pyramid settings,
      scary "!! SECURITY WARNING !!" are issued. This is arguably pointless in
      tests. So disable them in this case.
      a46fb3f58ea2
  5. 30 Nov, 2017 3 commits
    • Denis Laxalde's avatar
      [ssplanner] Prevent execution of write queries involving computed relations · 68ca7fe0ca29
      Denis Laxalde authored
      Previously, setting a computed relation upon entity creation or
      modification (using the ORM or an RQL query) would usually fail with an
      operational error in the backend ("no such table"). However, under some
      mysterious circumstances (like passing a string as value in cw_set for a
      computed relation), the RQL to SQL transformation would simply drop the
      clause.
      
      To prevent this to happen, we add a check for computed relation before
      adding a relation to an execution plan. This check raises a QueryError.
      It happens in several places:
      
      * in querier.InsertPlan.add_relation_def() (called from several places
        in ssplanner steps) for INSERT queries,
      * in ssplanner.UpdateStep.execute() for SET queries and,
      * in ssplanner.SSplanner.build_delete_plan() for DELETE queries.
      
      Tests added to unittest_querier.py because unittest_sslplanner.py looked
      inappropriate (it has only unit tests) and the former already had a
      NonRegressionTC class.
      68ca7fe0ca29
    • Denis Laxalde's avatar
      [querier] Expand 'rdef' argument in InsertPlan.add_relation_def() · 06deb43c23c3
      Denis Laxalde authored
      Expand the 'rdef' tuple to improve readability. The 'rtype' value is not
      used at the moment, but will in the next changeset.
      06deb43c23c3
    • Denis Laxalde's avatar
  6. 03 Nov, 2017 4 commits
  7. 30 Oct, 2017 1 commit
  8. 24 Oct, 2017 1 commit
  9. 17 Oct, 2017 2 commits
  10. 06 Oct, 2017 6 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
      [rtags] Enhance repr of rtags · f2e6fb5ddf68
      Sylvain Thénault authored
      * we don't care of the class, the registry id is enough (never seen a case of
        sub-classing)
      
      * add the module from which the rtag is coming as well as parent rtag if any.
      
      --HG--
      branch : 3.25
      f2e6fb5ddf68
    • 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
    • Adrien Di Mascio's avatar
      [web] fix session /cnx mix in anonymized_request · 2fc04786dd36
      Adrien Di Mascio authored
      --HG--
      branch : 3.25
      2fc04786dd36
    • Sylvain Thénault's avatar
      [test] Pin some test dependencies · a97cdb531a75
      Sylvain Thénault authored
      We currently have CI failures because cubes used as test dependencies have been
      updated to new-style cube layout. To avoid this, pin them to previous released.
      
      Those dependencies should be removed but in the mean time this should be enough
      (and backported in all active branches).
      
      --HG--
      branch : 3.25
      a97cdb531a75
  11. 05 Oct, 2017 1 commit
    • Sylvain Thénault's avatar
      [web/form] Relax condition for non-translating field names · 95e0883e2375
      Sylvain Thénault authored
      we should test true condition instead of None, so if one raise a ValidationError
      using an empty string as 'no-field' marker instead of None, we don't get the PO
      file header that gettext likes to return when one attempt to translate an empty
      string.
      
      --HG--
      branch : 3.25
      95e0883e2375
  12. 26 Sep, 2017 1 commit
    • Denis Laxalde's avatar
      [entities] Restore dc_ methods instead of __getattr__ proxy · 1c912b7d9503
      Denis Laxalde authored
      In 8de62610cea2, a __getattr__ proxy was introduced to handle compatibility
      with dc_* methods being called on entity instances instead of through the
      IDublinCore adapter. Unfortunately, __getattr__ does not play well with
      super() and since the latter is often used by, we here restore all dc_ methods
      with an explicit proxy to the adapter. More verbose but should work.
      
      Closes #17103999.
      
      --HG--
      branch : 3.25
      1c912b7d9503
  13. 15 Sep, 2017 4 commits
  14. 29 Nov, 2017 3 commits
    • Denis Laxalde's avatar
      [gcdebug] Only ignore weakref.WeakKeyDictionary class on Python 2 · 24393ce335f5
      Denis Laxalde authored
      From Python 3.5, this class fails isinstance check with the following
      error:
      
      ::
      
          cls = <class 'weakref.WeakKeyDictionary'>, instance = <functools._lru_list_elem object at 0x7f4331859a48>
      
              def __instancecheck__(cls, instance):
                  """Override for isinstance(instance, cls)."""
                  # Inline the cache checking
          >       subclass = instance.__class__
          E       AssertionError: [<class 'AttributeError'> in gc] 'functools._lru_list_elem' object has no attribute '__class__'
      
          /usr/lib/python3.5/abc.py:181: AssertionError
      
      
      I have no clue why this happens, but it makes
      cubicweb.web.test.test_views.AutomaticWebTest.test_startup_views fail on
      Python 3.5. So only consider this class for Python 2.
      24393ce335f5
    • Denis Laxalde's avatar
      [wsgi] Convert "code" passed to WSGIResponse as integer · 55924e962cd7
      Denis Laxalde authored
      WSGIResponse is passed a Request.status_out in
      CubicWebWSGIApplication._render(), which, starting from Python 3.5, is
      an instance of HTTPStatus.
      However, webtest still expects a 3-digits value as status string.
      Fortunately, calling int() on an HTTPStatus works.
      55924e962cd7
    • Denis Laxalde's avatar
      [test] Add a "version" to cubicweb_mycube/__pkginfo__.py · 93dc77e9da77
      Denis Laxalde authored
      Starting from Python 3.5, unittest_cwctl.py::CubicWebCtlTC.test_list()
      would fail without this.
      93dc77e9da77
  15. 28 Nov, 2017 1 commit
  16. 03 Nov, 2017 1 commit
  17. 30 Oct, 2017 2 commits