equal
deleted
inserted
replaced
35 from cubicweb.schema import constraint_name_for |
35 from cubicweb.schema import constraint_name_for |
36 from cubicweb.server.sqlutils import SQL_PREFIX |
36 from cubicweb.server.sqlutils import SQL_PREFIX |
37 from cubicweb.server.migractions import ServerMigrationHelper |
37 from cubicweb.server.migractions import ServerMigrationHelper |
38 from cubicweb.server.sources import storages |
38 from cubicweb.server.sources import storages |
39 from cubicweb.server.schema2sql import build_index_name |
39 from cubicweb.server.schema2sql import build_index_name |
|
40 from cubicweb.server.test.unittest_storage import StorageTC |
40 |
41 |
41 import cubicweb.devtools |
42 import cubicweb.devtools |
42 |
43 |
43 |
44 |
44 HERE = osp.dirname(osp.abspath(__file__)) |
45 HERE = osp.dirname(osp.abspath(__file__)) |
832 bill.cw_clear_all_caches() |
833 bill.cw_clear_all_caches() |
833 self.assertIsNone(bill.photo) |
834 self.assertIsNone(bill.photo) |
834 storages.unset_attribute_storage(self.repo, 'Personne', 'photo') |
835 storages.unset_attribute_storage(self.repo, 'Personne', 'photo') |
835 |
836 |
836 |
837 |
|
838 class MigrationStorageCommandsTC(StorageTC, MigrationCommandsTC): |
|
839 |
|
840 def test_change_bfss_path(self): |
|
841 with self.mh() as (cnx, mh): |
|
842 file1 = mh.cmd_create_entity('File', data_name=u"foo.pdf", |
|
843 data=Binary(b"xxx"), data_format=u'text/plain') |
|
844 mh.commit() |
|
845 current_dir = osp.dirname(self.fspath(cnx, file1)) |
|
846 |
|
847 mh.update_bfss_path(current_dir, 'loutre', commit=True) |
|
848 |
|
849 self.assertEqual(u'loutre', osp.dirname(self.fspath(cnx, file1))) |
|
850 |
|
851 |
837 class MigrationCommandsComputedTC(MigrationTC): |
852 class MigrationCommandsComputedTC(MigrationTC): |
838 """ Unit tests for computed relations and attributes |
853 """ Unit tests for computed relations and attributes |
839 """ |
854 """ |
840 appid = 'datacomputed' |
855 appid = 'datacomputed' |
841 |
856 |