Skip to content

Commit

Permalink
Remove traces of attempts to manually control times.
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasgraf committed Sep 19, 2019
1 parent 16f5cf8 commit b3e884c
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions src/plone/restapi/tests/test_documentation.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from base64 import b64encode
from datetime import datetime
from DateTime import DateTime
from mock import patch
from pkg_resources import parse_version
from pkg_resources import resource_filename
Expand Down Expand Up @@ -196,9 +195,6 @@ def create_document(self):
"text/plain",
"text/html",
)
document.creation_date = DateTime("2016-01-21T01:14:48+00:00")
document.reindexObject()
document.modification_date = DateTime("2016-01-21T01:24:11+00:00")
return document

def create_folder(self):
Expand All @@ -208,8 +204,6 @@ def create_folder(self):
folder.description = u"This is a folder with two documents"
folder.invokeFactory("Document", id="doc1", title="A document within a folder")
folder.invokeFactory("Document", id="doc2", title="A document within a folder")
folder.creation_date = DateTime("2016-01-21T07:14:48+00:00")
folder.modification_date = DateTime("2016-01-21T07:24:11+00:00")
return folder

def tearDown(self):
Expand Down Expand Up @@ -271,8 +265,6 @@ def test_documentation_news_item(self):
data=image_data, contentType="image/png", filename=u"image.png"
)
self.portal.newsitem.image_caption = u"This is an image caption."
self.portal.newsitem.creation_date = DateTime("2016-01-21T02:14:48+00:00")
self.portal.newsitem.modification_date = DateTime("2016-01-21T02:24:11+00:00")
transaction.commit()

with patch.object(storage, "uuid4", return_value="uuid1"):
Expand All @@ -285,8 +277,6 @@ def test_documentation_event(self):
self.portal.event.description = u"This is an event"
self.portal.event.start = datetime(2013, 1, 1, 10, 0)
self.portal.event.end = datetime(2013, 1, 1, 12, 0)
self.portal.event.creation_date = DateTime("2016-01-21T03:14:48+00:00")
self.portal.event.modification_date = DateTime("2016-01-21T03:24:11+00:00")
transaction.commit()
response = self.api_session.get(self.portal.event.absolute_url())
save_request_and_response_for_docs("event", response)
Expand All @@ -296,8 +286,6 @@ def test_documentation_link(self):
self.portal.link.title = "My Link"
self.portal.link.description = u"This is a link"
self.portal.remoteUrl = "http://plone.org"
self.portal.link.creation_date = DateTime("2016-01-21T04:14:48+00:00")
self.portal.link.modification_date = DateTime("2016-01-21T04:24:11+00:00")
transaction.commit()
response = self.api_session.get(self.portal.link.absolute_url())
save_request_and_response_for_docs("link", response)
Expand All @@ -312,8 +300,6 @@ def test_documentation_file(self):
self.portal.file.file = NamedBlobFile(
data=pdf_data, contentType="application/pdf", filename=u"file.pdf"
)
self.portal.file.creation_date = DateTime("2016-01-21T05:14:48+00:00")
self.portal.file.modification_date = DateTime("2016-01-21T05:24:11+00:00")
transaction.commit()
response = self.api_session.get(self.portal.file.absolute_url())
save_request_and_response_for_docs("file", response)
Expand All @@ -328,8 +314,6 @@ def test_documentation_image(self):
self.portal.image.image = NamedBlobImage(
data=image_data, contentType="image/png", filename=u"image.png"
)
self.portal.image.creation_date = DateTime("2016-01-21T06:14:48+00:00")
self.portal.image.modification_date = DateTime("2016-01-21T06:24:11+00:00")
transaction.commit()
with patch.object(storage, "uuid4", return_value="uuid1"):
response = self.api_session.get(self.portal.image.absolute_url())
Expand All @@ -354,8 +338,6 @@ def test_documentation_collection(self):
]
self.portal.invokeFactory("Document", id="doc1", title="Document 1")
self.portal.invokeFactory("Document", id="doc2", title="Document 2")
self.portal.collection.creation_date = DateTime("2016-01-21T08:14:48+00:00")
self.portal.collection.modification_date = DateTime("2016-01-21T08:24:11+00:00")
transaction.commit()
response = self.api_session.get(self.portal.collection.absolute_url())
save_request_and_response_for_docs("collection", response)
Expand Down Expand Up @@ -1364,9 +1346,6 @@ def create_document(self):
"text/plain",
"text/html",
)
document.creation_date = DateTime("2016-01-21T01:14:48+00:00")
document.reindexObject()
document.modification_date = DateTime("2016-01-21T01:24:11+00:00")
return document

def tearDown(self):
Expand Down Expand Up @@ -1448,9 +1427,6 @@ def create_document_with_comments(self):
"text/plain",
"text/html",
)
document.creation_date = DateTime("2016-01-21T01:14:48+00:00")
document.reindexObject()
document.modification_date = DateTime("2016-01-21T01:24:11+00:00")

# Add a bunch of comments to the default conversation so we can do
# batching
Expand Down

0 comments on commit b3e884c

Please sign in to comment.