|
@@ -452,6 +452,48 @@ class TestWebDav(TestStandard):
|
452
|
452
|
)
|
453
|
453
|
)
|
454
|
454
|
|
|
455
|
+ def test_unit__move_content__ok__another_workspace(self):
|
|
456
|
+ provider = self._get_provider()
|
|
457
|
+ environ = self._get_environ(
|
|
458
|
+ provider,
|
|
459
|
+ 'bob@fsf.local',
|
|
460
|
+ )
|
|
461
|
+ content_to_move_res = provider.getResourceInst(
|
|
462
|
+ '/w1/w1f1/w1f1d1.txt',
|
|
463
|
+ environ,
|
|
464
|
+ )
|
|
465
|
+
|
|
466
|
+ content_to_move = DBSession.query(ContentRevisionRO) \
|
|
467
|
+ .filter(Content.label == 'w1f1d1') \
|
|
468
|
+ .one() # It must exist only one revision, cf fixtures
|
|
469
|
+ ok_(content_to_move, msg='w1f1d1 should be exist')
|
|
470
|
+ content_to_move_id = content_to_move.content_id
|
|
471
|
+ content_to_move_parent = content_to_move.parent
|
|
472
|
+ eq_(
|
|
473
|
+ content_to_move_parent.label,
|
|
474
|
+ 'w1f1',
|
|
475
|
+ msg='field parent should be w1f1',
|
|
476
|
+ )
|
|
477
|
+
|
|
478
|
+ content_to_move_res.moveRecursive('/w2/w2f1/w1f1d1.txt') # move in w2, f1
|
|
479
|
+
|
|
480
|
+ # Database content is moved
|
|
481
|
+ content_to_move = DBSession.query(ContentRevisionRO) \
|
|
482
|
+ .filter(ContentRevisionRO.content_id == content_to_move_id) \
|
|
483
|
+ .order_by(ContentRevisionRO.revision_id.desc()) \
|
|
484
|
+ .first()
|
|
485
|
+
|
|
486
|
+ ok_(
|
|
487
|
+ content_to_move.parent,
|
|
488
|
+ msg='Content should have a parent'
|
|
489
|
+ )
|
|
490
|
+ ok_(
|
|
491
|
+ content_to_move.parent.label == 'w2f1',
|
|
492
|
+ msg='file should be moved in w2f1 but is in {0}'.format(
|
|
493
|
+ content_to_move.parent.label
|
|
494
|
+ )
|
|
495
|
+ )
|
|
496
|
+
|
455
|
497
|
def test_unit__update_content__ok(self):
|
456
|
498
|
provider = self._get_provider()
|
457
|
499
|
environ = self._get_environ(
|