Skip to content

Commit

Permalink
Move r110561 to a branch; not ready for release yet
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpieters committed Mar 19, 2010
1 parent b6d0154 commit 7072cf6
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 262 deletions.
13 changes: 0 additions & 13 deletions TODO.txt
Expand Up @@ -20,16 +20,3 @@ TODO

With a black box section that could even be done without variable
substitution.

- Improve userconstructor section:

plone.app.transmogrifier.userconstructor is very simple, it allows to create
a user and set his full name and email. A better approach might be to split
this blueprint into two independent blueprints:

- userconstructor which is responsible for create a user with the couple
userid/password.

- userpropertiesupdater which is responsible to update the member's properties.


6 changes: 0 additions & 6 deletions docs/HISTORY.txt
Expand Up @@ -6,12 +6,6 @@ Change History
1.1 (unreleased)
================

- Added support for empty layout and empty defaultpage. Don't set if empty
[toutpt]

- Added UserConstructor section. See userconstructor.txt.
[sylvainb]

- Added Indexing section. See reindexobject.txt.
[sylvainb]

Expand Down
1 change: 0 additions & 1 deletion setup.py
Expand Up @@ -19,7 +19,6 @@ def read(*rnames):
read('src', 'plone', 'app', 'transmogrifier', 'urlnormalizer.txt'), '',
read('src', 'plone', 'app', 'transmogrifier', 'mimeencapsulator.txt'), '',
read('src', 'plone', 'app', 'transmogrifier', 'reindexobject.txt'), '',
read('src', 'plone', 'app', 'transmogrifier', 'userconstructor.txt'), '',

read('docs', 'HISTORY.txt'), '',

Expand Down
5 changes: 0 additions & 5 deletions src/plone/app/transmogrifier/configure.zcml
Expand Up @@ -47,9 +47,4 @@
name="plone.app.transmogrifier.reindexobject"
/>

<utility
component=".userconstructor.UserConstructorSection"
name="plone.app.transmogrifier.userconstructor"
/>

</configure>
3 changes: 1 addition & 2 deletions src/plone/app/transmogrifier/reindexobject.txt
Expand Up @@ -45,8 +45,7 @@ Paths to objects are always interpreted as relative to the context.
... [printer]
... blueprint = collective.transmogrifier.sections.tests.pprinter
... """
>>> registerConfig(u'plone.app.transmogrifier.tests.reindexobject',
... reindexobject)
>>> registerConfig(u'plone.app.transmogrifier.tests.reindexobject', reindexobject)

>>> transmogrifier(u'plone.app.transmogrifier.tests.reindexobject')
[('_path', '/spam/eggs/foo')]
Expand Down
72 changes: 1 addition & 71 deletions src/plone/app/transmogrifier/tests.py
Expand Up @@ -380,6 +380,7 @@ def __init__(self, *args, **kw):
provideUtility(UIDSource,
name=u'plone.app.transmogrifier.tests.uidsource')


def reindexObjectSetup(test):
sectionsSetUp(test)

Expand Down Expand Up @@ -433,74 +434,6 @@ def __init__(self, *args, **kw):
provideUtility(ReindexObjectSource,
name=u'plone.app.transmogrifier.tests.reindexobjectsource')

def userConstructorSetup(test):
sectionsSetUp(test)

from Products.Archetypes.interfaces import IBaseObject

class MockPortal(object):
implements(IBaseObject)

@property
def portal_membership(self):
return self

added_users = ()
added_member_areas = ()

def getMemberById(self, userid):
if userid == 'existing_user':
return object()
return None

def addMember(self, userid, password, roles, domains,
properties=None):
props = ', '.join([properties[pp] for pp in properties])
user = '%s with roles %s: %s' % (userid, roles, props)
self.added_users += (user,)
return

def createMemberArea(self, member_id):
self.added_member_areas += (('/Members/%s' % member_id),)

test.globs['plone'] = MockPortal()
test.globs['transmogrifier'].context = test.globs['plone']

class UserConstructorSource(SampleSource):
classProvides(ISectionBlueprint)
implements(ISection)

def __init__(self, *args, **kw):
super(UserConstructorSource, self).__init__(*args, **kw)
self.sample = (
# will be added
dict(_userid ='foo', _password='foopwd', _email='foo@foo.com',
_fullname='Foo', _roles='Member'),
# will be added
dict(_userid ='bar', _password='barpwd', _email='bar@bar.com',
_fullname='Bar', _roles=('Member',)),
# will be added
dict(_userid ='admin', _password='adm', _email='adm@adm.com',
_fullname='Administrator', _roles=('Member', 'Manager')),
# will be added, with a member area
dict(_userid ='with_member_area', _password='pwd',
_email='member@area.com', _fullname='User',
_roles='Member'),
# not enought infos
dict(_userid ='baduser'),
# missing fullname
dict(_userid ='baduser2', _password='bad', _email='bad@bad.com',
_roles='Member'),
# not enought infos
dict(_userid ='baduser'),
# existing user, will not be created or updated
dict(_userid ='existing_user', _password='pwd',
_email='existing@user.com', _fullname='Existing User',
_roles='Member'),
)
provideUtility(UserConstructorSource,
name=u'plone.app.transmogrifier.tests.userconstructorsource')

def test_suite():
return unittest.TestSuite((
doctest.DocFileSuite(
Expand Down Expand Up @@ -529,7 +462,4 @@ def test_suite():
doctest.DocFileSuite(
'reindexobject.txt',
setUp=reindexObjectSetup, tearDown=tearDown),
doctest.DocFileSuite(
'userconstructor.txt',
setUp=userConstructorSetup, tearDown=tearDown),
))
68 changes: 0 additions & 68 deletions src/plone/app/transmogrifier/userconstructor.py

This file was deleted.

96 changes: 0 additions & 96 deletions src/plone/app/transmogrifier/userconstructor.txt

This file was deleted.

0 comments on commit 7072cf6

Please sign in to comment.