Пример #1
0
 def test_not_renameable_and_no_new_name_should_not_rename(self):
     from zeit.cms.repository.interfaces import IAutomaticallyRenameable
     content = self.get_content()
     from zeit.cms.checkout.helper import checked_out
     with checked_out(content) as co:
         renameable = IAutomaticallyRenameable(co)
         renameable.renameable = False
     self.assertNotIn('new-name', content.__parent__.keys())
     self.assertIn('testcontent', content.__parent__.keys())
Пример #2
0
 def test_renameable_should_be_none_after_rename(self):
     from zeit.cms.repository.interfaces import IAutomaticallyRenameable
     content = self.get_content()
     from zeit.cms.checkout.helper import checked_out
     with checked_out(content) as co:
         renameable = IAutomaticallyRenameable(co)
         renameable.renameable = True
         renameable.rename_to = u'new-name'
     content = self.get_content('new-name')
     renameable = IAutomaticallyRenameable(content)
     # Test for None as this is the value which we get when the DAV property
     # does not exist. And thats what we really want.
     self.assertIsNone(renameable.renameable)
     self.assertIsNone(renameable.rename_to)