|
1 | 1 | from base64 import b64encode |
2 | 2 | from datetime import datetime |
3 | | -from unittest.mock import patch |
4 | 3 | from pkg_resources import resource_filename |
5 | 4 | from plone import api |
6 | 5 | from plone.app.discussion.interfaces import IConversation |
|
25 | 24 | from plone.restapi.testing import PLONE_RESTAPI_ITERATE_FUNCTIONAL_TESTING |
26 | 25 | from plone.restapi.testing import register_static_uuid_utility |
27 | 26 | from plone.restapi.testing import RelativeSession |
| 27 | +from plone.restapi.tests.helpers import patch_scale_uuid |
28 | 28 | from plone.restapi.tests.statictime import StaticTime |
29 | 29 | from plone.scale import storage |
30 | 30 | from plone.testing.z2 import Browser |
@@ -301,7 +301,8 @@ def test_documentation_news_item(self): |
301 | 301 | self.portal.newsitem.image_caption = "This is an image caption." |
302 | 302 | transaction.commit() |
303 | 303 |
|
304 | | - with patch.object(storage, "uuid4", return_value="uuid1"): |
| 304 | + scale_url_uuid = "uuid1" |
| 305 | + with patch_scale_uuid(scale_url_uuid): |
305 | 306 | response = self.api_session.get(self.portal.newsitem.absolute_url()) |
306 | 307 | save_request_and_response_for_docs("newsitem", response) |
307 | 308 |
|
@@ -349,7 +350,8 @@ def test_documentation_image(self): |
349 | 350 | data=image_data, contentType="image/png", filename="image.png" |
350 | 351 | ) |
351 | 352 | transaction.commit() |
352 | | - with patch.object(storage, "uuid4", return_value="uuid1"): |
| 353 | + scale_url_uuid = "uuid1" |
| 354 | + with patch_scale_uuid(scale_url_uuid): |
353 | 355 | response = self.api_session.get(self.portal.image.absolute_url()) |
354 | 356 | save_request_and_response_for_docs("image", response) |
355 | 357 |
|
|
0 commit comments