author | Sylvain Thénault <sylvain.thenault@logilab.fr> |
Wed, 27 Jan 2010 09:25:40 +0100 | |
changeset 4386 | cf8842b69379 |
parent 4212 | ab6573088b4a |
child 5421 | 8167de96c523 |
permissions | -rw-r--r-- |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
1 |
""" |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
2 |
|
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
3 |
:organization: Logilab |
4212
ab6573088b4a
update copyright: welcome 2010
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
2643
diff
changeset
|
4 |
:copyright: 2001-2010 LOGILAB S.A. (Paris, FRANCE), license is LGPL v2. |
1977
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
5 |
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
6 |
:license: GNU Lesser General Public License, v2.1 - http://www.gnu.org/licenses |
606923dff11b
big bunch of copyright / docstring update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
1646
diff
changeset
|
7 |
""" |
1646 | 8 |
from logilab.common.testlib import TestCase, unittest_main |
2643
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
9 |
from cubicweb.devtools.fake import FakeRequest |
1646 | 10 |
class AjaxReplaceUrlTC(TestCase): |
11 |
||
12 |
def test_ajax_replace_url(self): |
|
2643
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
13 |
req = FakeRequest() |
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
14 |
arurl = req.build_ajax_replace_url |
1646 | 15 |
# NOTE: for the simplest use cases, we could use doctest |
2643
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
16 |
self.assertEquals(arurl('foo', 'Person P', 'list'), |
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
17 |
"javascript: loadxhtml('foo', 'http://testing.fr/cubicweb/view?rql=Person%20P&__notemplate=1&vid=list', 'replace')") |
1646 | 18 |
self.assertEquals(arurl('foo', 'Person P', 'oneline', name='bar', age=12), |
2643
9976f511003b
web test update
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1977
diff
changeset
|
19 |
'''javascript: loadxhtml('foo', 'http://testing.fr/cubicweb/view?age=12&rql=Person%20P&__notemplate=1&vid=oneline&name=bar', 'replace')''') |
1646 | 20 |
|
21 |
||
22 |
if __name__ == '__main__': |
|
23 |
unittest_main() |