def test_is_current_with_single_version(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() version = page.update(user=user, content='hello') assert version.is_current is True
def test_is_current_with_single_version(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() version = page.update(user=user, content='hello') assert version.is_current is True
def test_is_current_deleted_page(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() ver1 = page.update(user=user, content='draft1') page.deleted = datetime.datetime(2017, 1, 1, 1, 00, tzinfo=pytz.utc) page.save() assert ver1.is_current is False
def test_is_current_with_multiple_versions(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() ver1 = page.update(user=user, content='draft1') ver2 = page.update(user=user, content='draft2') assert ver1.is_current is False assert ver2.is_current is True
def test_is_current_deleted_page(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() ver1 = page.update(user=user, content='draft1') page.deleted = datetime.datetime(2017, 1, 1, 1, 00, tzinfo=pytz.utc) page.save() assert ver1.is_current is False
def test_is_current_with_multiple_versions(self): user = UserFactory() node = NodeFactory() page = WikiPage(page_name='foo', node=node) page.save() ver1 = page.update(user=user, content='draft1') ver2 = page.update(user=user, content='draft2') assert ver1.is_current is False assert ver2.is_current is True