[entity] ensure the .related(entities=False) parameter is honored all the way down (closes #2755994)
As of today, such a call will always fill the relation cache by
calling .entities() on every single related rset entry.
As a consequence, the `limit` parameter handling also had to be fixed.
It was bogus in the following ways:
* not used in the related_rql, hence potentially huge database
requests, but also actually
* foolishly used in the .entities()-calling cache routine we now
bypass (this changeset ticket's main topic)
Now:
* we set a limit on the rql expression, and
* forbid caching if given a non-None limit (as we don't want to make
the cache handling code more complicated than it is already)
With this, entity.unrelated gets a better limit implementation (so the
code in related/unrelated is nice and symmetric)
Risk:
* _cw_relation_cache disappears completely, which is good, but this is
Python, so you never know ...
<html>
<head>
<script type="text/javascript" src="../../data/jquery.js"></script>
<script src="../../data/jquery.corner.js" type="text/javascript"></script>
<script src="../../data/cubicweb.js" type="text/javascript"></script>
<script src="../../data/cubicweb.python.js" type="text/javascript"></script>
<script src="../../data/cubicweb.compat.js" type="text/javascript"></script>
<script src="utils.js" type="text/javascript"></script>
<script type="text/javascript" src="qunit.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="qunit.css" />
<script src="cwmock.js" type="text/javascript"></script>
<script src="test_utils.js" type="text/javascript"></script>
</head>
<body>
<div id="main">
</div>
<h1 id="qunit-header">cw.utils functions tests</h1>
<h2 id="qunit-banner"></h2>
<h2 id="qunit-userAgent"></h2>
<ol id="qunit-tests">
</body>
</html>