This is actually a follow-up of my previous changeset (http://hg.moinmo.in/moin/2.0/rev/339668f8ad06). Notes: * Item methods are ...
12 years, 9 months ago
(2012-06-26 16:28:27 UTC)
#1
This is actually a follow-up of my previous changeset
(http://hg.moinmo.in/moin/2.0/rev/339668f8ad06). Notes:
* Item methods are refactored. The motivation is that the family of methods -
rename, delete, revert, destroy, modify to be request-agnostic. Previously
modify() looks into the request and take corresponding actions, and the split of
do_modify() and modify() is somehow arbitrary. The new code is cleaner and more
testable.
* As a result, test cases and frontend codes were modified too.
* I ran a py.test and there is no regression (compared to default branch). The
following were manually tested:
- Creating and modifying MoinWiki items
- Reverting an item
- Creating and modifying TWikiDraw, AnyWikiDraw and SvgDraw items
- Drag-and-drop to upload files in +index view (jfu)
No regression was observed.
* My previous change set broke creating item from template (template data is not
loaded). This patch set fixes it.
* Item template is now supported for Draw items too.
12 years, 9 months ago
(2012-06-27 06:07:54 UTC)
#4
answered
http://codereview.appspot.com/6330064/diff/1/MoinMoin/items/_tests/test_Item.py
File MoinMoin/items/_tests/test_Item.py (right):
http://codereview.appspot.com/6330064/diff/1/MoinMoin/items/_tests/test_Item....
MoinMoin/items/_tests/test_Item.py:293: another_data = 'another_test_data'
On 2012/06/27 03:39:25, xiaq wrote:
> On 2012/06/26 20:21:23, Reimar Bauer wrote:
> > u'....'
>
> I noticed this, but other code in test_Item.py use plain str literals. Should
> those all be converted to unicode literals?
Because that is ascii in the test text one can argument it is the same one byte
string as declared as unicode data type. But because all our methods handle
unicode strings I suggest to have also in tests unicode values used. We could
think on input validation (if not already done) for the data type too.
This is needs a separate changeset for fixing it on all places, I file an issue
for that fix.
looks ok, but see the minor comments. thanks for cleaning up there. http://codereview.appspot.com/6330064/diff/1/MoinMoin/items/__init__.py File MoinMoin/items/__init__.py ...
12 years, 9 months ago
(2012-06-28 16:41:08 UTC)
#5
Issue 6330064: More cleanup on items module.
(Closed)
Created 12 years, 9 months ago by xiaq
Modified 12 years, 9 months ago
Reviewers: thomas.j.waldmann_googlemail.com, Reimar Bauer
Base URL:
Comments: 20