equal
deleted
inserted
replaced
1 """unit tests for module cubicweb.server.sqlutils |
1 """unit tests for module cubicweb.server.sqlutils |
2 """ |
2 """ |
3 |
3 |
4 import sys |
4 import sys |
5 from mx.DateTime import now |
|
6 |
5 |
7 from logilab.common.testlib import TestCase, unittest_main |
6 from logilab.common.testlib import TestCase, unittest_main |
8 |
7 |
9 from cubicweb.server.sqlutils import * |
8 from cubicweb.server.sqlutils import * |
10 |
9 |
19 class SQLAdapterMixInTC(TestCase): |
18 class SQLAdapterMixInTC(TestCase): |
20 |
19 |
21 def test_init(self): |
20 def test_init(self): |
22 o = SQLAdapterMixIn(BASE_CONFIG) |
21 o = SQLAdapterMixIn(BASE_CONFIG) |
23 self.assertEquals(o.encoding, 'UTF-8') |
22 self.assertEquals(o.encoding, 'UTF-8') |
24 |
23 |
25 def test_init_encoding(self): |
24 def test_init_encoding(self): |
26 config = BASE_CONFIG.copy() |
25 config = BASE_CONFIG.copy() |
27 config['db-encoding'] = 'ISO-8859-1' |
26 config['db-encoding'] = 'ISO-8859-1' |
28 o = SQLAdapterMixIn(config) |
27 o = SQLAdapterMixIn(config) |
29 self.assertEquals(o.encoding, 'ISO-8859-1') |
28 self.assertEquals(o.encoding, 'ISO-8859-1') |
30 |
29 |
31 if __name__ == '__main__': |
30 if __name__ == '__main__': |
32 unittest_main() |
31 unittest_main() |