-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/master Date: 2018-02-18T09:11:03+07:00 Author: Dylan Jay (djay) <[email protected]> Commit: plone/plone.app.theming@58eb1ff add some tests for themefileupload as these fail with current plone.rest Files changed: M src/plone/app/theming/tests/test_controlpanel.py Repository: plone.app.theming Branch: refs/heads/master Date: 2018-03-14T14:50:11+07:00 Author: Dylan Jay (djay) <[email protected]> Commit: plone/plone.app.theming@7201b16 add to CHANGES.txt Files changed: M CHANGES.rst Repository: plone.app.theming Branch: refs/heads/master Date: 2018-03-18T18:33:41+01:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.app.theming@763853e Different writing: Ok in Zope2 vs OK in Zope4 Files changed: M src/plone/app/theming/tests/test_controlpanel.py Repository: plone.app.theming Branch: refs/heads/master Date: 2018-03-23T14:07:39+07:00 Author: Dylan Jay (djay) <[email protected]> Commit: plone/plone.app.theming@8a49cfa fix broken line wrap in test Files changed: M CHANGES.rst M src/plone/app/theming/tests/test_controlpanel.py Repository: plone.app.theming Branch: refs/heads/master Date: 2018-03-27T08:22:59+02:00 Author: Jens W. Klein (jensens) <[email protected]> Commit: plone/plone.app.theming@6bd6fe0 Merge pull request #140 from plone/djay/add_themefileupload_test add some tests for themefileupload as these fail with current plone.rest Files changed: M CHANGES.rst M src/plone/app/theming/tests/test_controlpanel.py
- Loading branch information
Showing
1 changed file
with
235 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,243 @@ | ||
Repository: mockup | ||
Repository: plone.app.theming | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-03-26T16:32:44-03:00 | ||
Author: Franco Pellegrini (frapell) <frapell@gmail.com> | ||
Commit: https://github.com/plone/mockup/commit/e482db250c4b88f3d07c18c7c8d4331b5a4154cc | ||
Date: 2018-02-18T09:11:03+07:00 | ||
Author: Dylan Jay (djay) <software@pretaweb.com> | ||
Commit: https://github.com/plone/plone.app.theming/commit/58eb1fffcb8de09d9690dbbeeeae8f1f690cc000 | ||
|
||
Make sure self.tiny is not null before setting its attribute | ||
add some tests for themefileupload as these fail with current plone.rest | ||
|
||
Files changed: | ||
M mockup/patterns/tinymce/pattern.js | ||
|
||
diff --git a/mockup/patterns/tinymce/pattern.js b/mockup/patterns/tinymce/pattern.js | ||
index 06b5d82c..96a7b813 100644 | ||
--- a/mockup/patterns/tinymce/pattern.js | ||
+++ b/mockup/patterns/tinymce/pattern.js | ||
@@ -412,7 +412,9 @@ define([ | ||
tinymce.init(tinyOptions); | ||
self.tiny = tinymce.get(self.tinyId); | ||
|
||
- self.tiny.initialized = true; | ||
+ if (self.tiny !== null){ | ||
+ self.tiny.initialized = true; | ||
+ } | ||
|
||
/* tiny really should be doing this by default | ||
* but this fixes overlays not saving data */ | ||
M src/plone/app/theming/tests/test_controlpanel.py | ||
|
||
diff --git a/src/plone/app/theming/tests/test_controlpanel.py b/src/plone/app/theming/tests/test_controlpanel.py | ||
index 9e88a59..2621e6c 100644 | ||
--- a/src/plone/app/theming/tests/test_controlpanel.py | ||
+++ b/src/plone/app/theming/tests/test_controlpanel.py | ||
@@ -51,3 +51,38 @@ def test_create_theme(self): | ||
|
||
# self.assertTrue('foobar' in [t.__name__ for t in getZODBThemes()]) | ||
# self.assertTrue(getTheme('foobar') is not None) | ||
+ | ||
+ | ||
+ def test_upload_theme_file_nodata(self): | ||
+ self.browser.addHeader('Accept', 'application/json') | ||
+ self.browser.post( | ||
+ self.portal.absolute_url() + '/portal_resources/themeFileUpload', | ||
+ '', | ||
+ ) | ||
+ self.assertIn('Status: 200 Ok', str(self.browser.headers)) | ||
+ self.assertIn( | ||
+ '{"failure": "error"}', | ||
+ str(self.browser.contents) | ||
+ ) | ||
+ | ||
+ def test_upload_theme_file_withdata(self): | ||
+ self.browser.addHeader('Accept', 'application/json') | ||
+ self.browser.post( | ||
+ self.portal.absolute_url() + '/portal_resources/themeFileUpload', | ||
+ """ | ||
+---blah--- | ||
+Content-Disposition: form-data; name="file"; filename="Screen Shot 2018-02-16 at 3.08.15 pm.png" | ||
+Content-Type: image/png | ||
+ | ||
+ | ||
+---blah--- | ||
+ """, | ||
+# Bug in testbrowser prevents this working | ||
+# content_type='multipart/form-data; boundary=---blah---' | ||
+ | ||
+ ) | ||
+ self.assertIn('Status: 200 Ok', str(self.browser.headers)) | ||
+ self.assertIn( | ||
+ '{"failure": "error"}', # TODO: Should be {'success':'create'} | ||
+ str(self.browser.contents) | ||
+ ) | ||
|
||
|
||
Repository: plone.app.theming | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-03-14T14:50:11+07:00 | ||
Author: Dylan Jay (djay) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.theming/commit/7201b16176fbefcbaaa5ef4a2e006806770e9aee | ||
|
||
add to CHANGES.txt | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 09eb373..d811bce 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -14,7 +14,8 @@ New features: | ||
|
||
Bug fixes: | ||
|
||
-- *add item here* | ||
+- Added a missing test for fileuploads in the theme editor that breaks when plone.rest is installed | ||
+ [djay] | ||
|
||
|
||
2.0.2 (2018-02-04) | ||
|
||
|
||
Repository: plone.app.theming | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-03-18T18:33:41+01:00 | ||
Author: Jens W. Klein (jensens) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.theming/commit/763853e06bc573ba797dada1b41f81ddaa741ceb | ||
|
||
Different writing: Ok in Zope2 vs OK in Zope4 | ||
|
||
Files changed: | ||
M src/plone/app/theming/tests/test_controlpanel.py | ||
|
||
diff --git a/src/plone/app/theming/tests/test_controlpanel.py b/src/plone/app/theming/tests/test_controlpanel.py | ||
index 2621e6c..d634b3a 100644 | ||
--- a/src/plone/app/theming/tests/test_controlpanel.py | ||
+++ b/src/plone/app/theming/tests/test_controlpanel.py | ||
@@ -59,7 +59,7 @@ def test_upload_theme_file_nodata(self): | ||
self.portal.absolute_url() + '/portal_resources/themeFileUpload', | ||
'', | ||
) | ||
- self.assertIn('Status: 200 Ok', str(self.browser.headers)) | ||
+ self.assertIn('Status: 200', str(self.browser.headers)) | ||
self.assertIn( | ||
'{"failure": "error"}', | ||
str(self.browser.contents) | ||
@@ -81,7 +81,8 @@ def test_upload_theme_file_withdata(self): | ||
# content_type='multipart/form-data; boundary=---blah---' | ||
|
||
) | ||
- self.assertIn('Status: 200 Ok', str(self.browser.headers)) | ||
+ self.assertIn('Status: 200 | ||
+ ', str(self.browser.headers)) | ||
self.assertIn( | ||
'{"failure": "error"}', # TODO: Should be {'success':'create'} | ||
str(self.browser.contents) | ||
|
||
|
||
Repository: plone.app.theming | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-03-23T14:07:39+07:00 | ||
Author: Dylan Jay (djay) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.theming/commit/8a49cfae5174e7edc6d9bb27c80421f43970d76c | ||
|
||
fix broken line wrap in test | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M src/plone/app/theming/tests/test_controlpanel.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index d811bce..772d72e 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -14,7 +14,7 @@ New features: | ||
|
||
Bug fixes: | ||
|
||
-- Added a missing test for fileuploads in the theme editor that breaks when plone.rest is installed | ||
+- Added a failing (5.1) test for fileuploads in the theme editor that breaks when plone.rest is installed. Fix is in https://github.com/plone/plone.rest/issues/59 | ||
[djay] | ||
|
||
|
||
diff --git a/src/plone/app/theming/tests/test_controlpanel.py b/src/plone/app/theming/tests/test_controlpanel.py | ||
index d634b3a..a1f443d 100644 | ||
--- a/src/plone/app/theming/tests/test_controlpanel.py | ||
+++ b/src/plone/app/theming/tests/test_controlpanel.py | ||
@@ -81,8 +81,7 @@ def test_upload_theme_file_withdata(self): | ||
# content_type='multipart/form-data; boundary=---blah---' | ||
|
||
) | ||
- self.assertIn('Status: 200 | ||
- ', str(self.browser.headers)) | ||
+ self.assertIn('Status: 200', str(self.browser.headers)) | ||
self.assertIn( | ||
'{"failure": "error"}', # TODO: Should be {'success':'create'} | ||
str(self.browser.contents) | ||
|
||
|
||
Repository: plone.app.theming | ||
|
||
|
||
Branch: refs/heads/master | ||
Date: 2018-03-27T08:22:59+02:00 | ||
Author: Jens W. Klein (jensens) <[email protected]> | ||
Commit: https://github.com/plone/plone.app.theming/commit/6bd6fe06f709a0777391ab43a195878619b4986c | ||
|
||
Merge pull request #140 from plone/djay/add_themefileupload_test | ||
|
||
add some tests for themefileupload as these fail with current plone.rest | ||
|
||
Files changed: | ||
M CHANGES.rst | ||
M src/plone/app/theming/tests/test_controlpanel.py | ||
|
||
diff --git a/CHANGES.rst b/CHANGES.rst | ||
index 09eb373..772d72e 100644 | ||
--- a/CHANGES.rst | ||
+++ b/CHANGES.rst | ||
@@ -14,7 +14,8 @@ New features: | ||
|
||
Bug fixes: | ||
|
||
-- *add item here* | ||
+- Added a failing (5.1) test for fileuploads in the theme editor that breaks when plone.rest is installed. Fix is in https://github.com/plone/plone.rest/issues/59 | ||
+ [djay] | ||
|
||
|
||
2.0.2 (2018-02-04) | ||
diff --git a/src/plone/app/theming/tests/test_controlpanel.py b/src/plone/app/theming/tests/test_controlpanel.py | ||
index 9e88a59..a1f443d 100644 | ||
--- a/src/plone/app/theming/tests/test_controlpanel.py | ||
+++ b/src/plone/app/theming/tests/test_controlpanel.py | ||
@@ -51,3 +51,38 @@ def test_create_theme(self): | ||
|
||
# self.assertTrue('foobar' in [t.__name__ for t in getZODBThemes()]) | ||
# self.assertTrue(getTheme('foobar') is not None) | ||
+ | ||
+ | ||
+ def test_upload_theme_file_nodata(self): | ||
+ self.browser.addHeader('Accept', 'application/json') | ||
+ self.browser.post( | ||
+ self.portal.absolute_url() + '/portal_resources/themeFileUpload', | ||
+ '', | ||
+ ) | ||
+ self.assertIn('Status: 200', str(self.browser.headers)) | ||
+ self.assertIn( | ||
+ '{"failure": "error"}', | ||
+ str(self.browser.contents) | ||
+ ) | ||
+ | ||
+ def test_upload_theme_file_withdata(self): | ||
+ self.browser.addHeader('Accept', 'application/json') | ||
+ self.browser.post( | ||
+ self.portal.absolute_url() + '/portal_resources/themeFileUpload', | ||
+ """ | ||
+---blah--- | ||
+Content-Disposition: form-data; name="file"; filename="Screen Shot 2018-02-16 at 3.08.15 pm.png" | ||
+Content-Type: image/png | ||
+ | ||
+ | ||
+---blah--- | ||
+ """, | ||
+# Bug in testbrowser prevents this working | ||
+# content_type='multipart/form-data; boundary=---blah---' | ||
+ | ||
+ ) | ||
+ self.assertIn('Status: 200', str(self.browser.headers)) | ||
+ self.assertIn( | ||
+ '{"failure": "error"}', # TODO: Should be {'success':'create'} | ||
+ str(self.browser.contents) | ||
+ ) | ||
|
||
|