Merge branch 'issue-756' of https://github.com/kaedroho/wagtail into kaedroho-issue-756

Conflicts:
	wagtail/wagtailcore/tests/test_page_model.py
pull/757/merge
Matt Westcott 2014-10-31 10:45:00 +00:00
commit e00ae6bdc0
2 zmienionych plików z 20 dodań i 0 usunięć

Wyświetl plik

@ -1037,6 +1037,7 @@ class PageRevision(models.Model):
obj.has_unpublished_changes = self.page.has_unpublished_changes
obj.owner = self.page.owner
obj.locked = self.page.locked
obj.latest_revision_created_at = self.page.latest_revision_created_at
return obj

Wyświetl plik

@ -620,3 +620,22 @@ class TestIssue735(TestCase):
# Check that the christmas events url path updated correctly
new_christmas_event = EventPage.objects.get(id=christmas_event.id)
self.assertEqual(new_christmas_event.url_path, '/home/old-events/christmas/')
class TestIssue756(TestCase):
"""
Issue 756 reports that the latest_revision_created_at
field was getting clobbered whenever a revision was published
"""
def test_publish_revision_doesnt_remove_latest_revision_created_at(self):
# Create a revision
revision = Page.objects.get(id=1).save_revision()
# Check that latest_revision_created_at is set
self.assertIsNotNone(Page.objects.get(id=1).latest_revision_created_at)
# Publish the revision
revision.publish()
# Check that latest_revision_created_at is still set
self.assertIsNotNone(Page.objects.get(id=1).latest_revision_created_at)