equal
deleted
inserted
replaced
|
1 from logilab.common import tempattr |
|
2 from cubicweb.devtools.testlib import CubicWebTC |
|
3 |
|
4 |
|
5 class SynchronizeSourceTC(CubicWebTC): |
|
6 def test_synchronize_view(self): |
|
7 with self.admin_access.web_request(vid='cw.source-sync') as req: |
|
8 source = req.create_entity('CWSource', name=u'ext', type=u'datafeed', |
|
9 parser=u'cw.entityxml') |
|
10 req.cnx.commit() |
|
11 |
|
12 self.threads = 0 |
|
13 |
|
14 def threaded_task(func): |
|
15 self.threads += 1 |
|
16 |
|
17 with tempattr(req.cnx.repo, 'threaded_task', threaded_task): |
|
18 path, args = self.expect_redirect_handle_request( |
|
19 req, path=source.rest_path()) |
|
20 self.assertEqual(self.threads, 1) |
|
21 self.assertTrue(path.startswith('cwdataimport/')) |
|
22 |
|
23 |
|
24 if __name__ == '__main__': |
|
25 import unittest |
|
26 unittest.main() |