kopia lustrzana https://github.com/wagtail/wagtail
Merge branch 'issue-756' of https://github.com/kaedroho/wagtail into kaedroho-issue-756
Conflicts: wagtail/wagtailcore/tests/test_page_model.pypull/757/merge
commit
e00ae6bdc0
|
@ -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
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue