test/unittest_rset.py
changeset 5752 b0bb553e3be4
parent 5687 3ea39709b50e
parent 5747 d6ac0cd30fde
child 6142 8bc6eac1fac1
child 6195 a0c4441e6ddf
equal deleted inserted replaced
5743:4a0600664f85 5752:b0bb553e3be4
    19 """unit tests for module cubicweb.utils
    19 """unit tests for module cubicweb.utils
    20 
    20 
    21 """
    21 """
    22 
    22 
    23 from urlparse import urlsplit
    23 from urlparse import urlsplit
       
    24 import pickle
    24 
    25 
    25 from rql import parse
    26 from rql import parse
    26 
    27 
    27 from logilab.common.testlib import TestCase, unittest_main, mock_object
    28 from logilab.common.testlib import TestCase, unittest_main, mock_object
    28 
    29 
    82         if info1[3] != info2[3]:
    83         if info1[3] != info2[3]:
    83             params1 = dict(pair.split('=') for pair in info1[3].split('&'))
    84             params1 = dict(pair.split('=') for pair in info1[3].split('&'))
    84             params2 = dict(pair.split('=') for pair in info1[3].split('&'))
    85             params2 = dict(pair.split('=') for pair in info1[3].split('&'))
    85             self.assertDictEquals(params1, params2)
    86             self.assertDictEquals(params1, params2)
    86 
    87 
       
    88     def test_pickle(self):
       
    89         del self.rset.req
       
    90         self.assertEquals(len(pickle.dumps(self.rset)), 392)
    87 
    91 
    88     def test_build_url(self):
    92     def test_build_url(self):
    89         req = self.request()
    93         req = self.request()
    90         baseurl = req.base_url()
    94         baseurl = req.base_url()
    91         self.compare_urls(req.build_url('view', vid='foo', rql='yo'),
    95         self.compare_urls(req.build_url('view', vid='foo', rql='yo'),