paula.testing: test for finding txt files + minor bugfix
[paula/paual.testing.git] / paula.plonepas / src / paula / plonepas / integration-paula.txt
blobc4f03aed3e6e2735d8670ab2bc2da32dfe939736
1 Currently unused
4 paula.plonepas Package Readme
5 =============================
7     >>> from paula.suite import createPaulaSuite
8     >>> root = getRootFolder()
9     >>> creatPaulaSuite(root, create_pau=True, create_credplugin=True)
14 A minimal plone user:
16     >>> from paula.examples.content import MinimalPloneUser
17     >>> user = MinimalPloneUser(
18     ...     name=u"login",
19     ...     password=u"correct",
20     ...     email=u"foo@bar.com",
21     ...     realname=u"Foo Bar",
22     ...     )
25 Create our PlonePAS authentication plugin and try to authenticate
27     >>> from paula.plonepas.plugins.auth import AuthenticationPlugin
28     >>> pas_ap = AuthenticationPlugin('pas_ap')
30 wrong password
32     >>> creds = {}
33     >>> creds['login']="login"
34     >>> creds['password']="wrong"
35     >>> pas_ap.authenticateCredentials(creds) is None
36     True
38 matching credentials
40     >>> creds['password']="correct"
41     >>> pas_ap.authenticateCredentials(creds)
42     ('login', 'login')
44 non-existant username
46     >>> creds['login']="wrong"
47     >>> pas_ap.authenticateCredentials(creds) is None
48     True
56 Create our PlonePAS properties plugin and try to fetch properties
58     >>> from paula.plonepas.plugins.properties import PropertiesPlugin
59     >>> pas_pp = PropertiesPlugin('pas_pp')
61 a mock plone user
63     >>> ploneuser = Mock(getId = lambda : u"login")
64     >>> psheet = pas_pp.getPropertiesForUser(ploneuser)
65     >>> psheet.getId()
66     'pas_pp'
67     >>> psheet.propertyIds()
68     ['email', 'realname']
69     >>> psheet.propertyValues()
70     [u'foo@bar.com', u'Foo Bar']