Laurent Lasudry
7a2ed86ab4
Improve get_state to avoid errors
2019-10-25 10:06:11 +02:00
Frédéric Péters
6aae162385
let adopt_user get to the zope admin user
2014-03-24 11:31:19 +01:00
Nejc Zupan
71d99690bf
Merge pull request #153 from jcerjak/master
...
Use getPhysicalPath instead of absolute_url_path in api.content.get()
2014-01-27 15:05:42 -08:00
Artur Barseghyan
c7fdf09962
Update user.py
...
At the moment ``isAnonymousUser`` returns <int> values. Fix to explicitly cast to boolean.
2014-01-22 10:46:39 +01:00
Matthew Sital-Singh
f8dac9c4c7
Catch AttributeError in ``api.content.get``
...
unrestrictedTraverse raises an AttributeError if the first part of the path can be traversed. If we are catching KeyError here we should do the same for AttributeError.
2013-12-20 17:16:12 +00:00
jcerjak
1070984775
use getPhysicalPath instead of absolute_url_path, refs #152
2013-12-16 19:01:12 +01:00
Matthew Sital-Singh
749584334f
Add test to ensure UnicodeDecodeErrors not swallowed
...
This test registers a title indexer that forces a UnicodeException during the creation of an content item, and checks that it is not swallowed by api.content.create
2013-11-26 09:59:48 +00:00
Matthew Sital-Singh
37fcb36b8c
Update exception syntax
2013-11-26 09:57:42 +00:00
Matthew Sital-Singh
465315a7f6
Prevent UnicodeDecodeErrors from being swallowed
...
UnicodeDecodeError is a subclass of ValueError, so these exceptions were being swallowed by the InvalidParameterError handling.
2013-11-25 16:34:59 +00:00
Nejc Zupan
af5719b40c
Merge pull request #148 from plone/env-versions
...
Add api.env.plone_version() and api.env.zope_version()
2013-11-05 23:47:02 -08:00
hvelarde
d2ec150999
Refactor tests of env.plone_version() and env.zope_version() using regular expressions
...
And now we have 2 problems
2013-10-17 15:45:30 -03:00
hvelarde
16bc0c731f
Add api.env.plone_version() and api.env.zope_version() (refs. #126 )
2013-10-17 10:39:59 -03:00
Cillian de Róiste
654f749ff7
api.user.get_roles(): add the option to ignore inherited roles
2013-10-14 13:31:03 +02:00
Nejc Zupan
43b580ab69
garden
2013-10-09 21:11:24 -03:00
Rodrigo Ferreira de Souza
e083196049
Review copy/move/rename methods
2013-10-09 19:37:47 -03:00
Simon Delcourt
6774bcf382
added test_mode() method
2013-10-09 19:31:41 -03:00
winstonf88
54d82772a2
changed all assertRaises in tests to use the with statement
2013-10-09 19:24:08 -03:00
Nejc Zupan
9b61b801e1
garden
2013-10-09 17:07:55 -03:00
Florent Michon
7a75f794e5
Use plone.recipe.codeanalysis
...
Integrate plone.recipe.codeanalysis in the buildout and correct the trivials
errors.
2013-10-09 16:56:47 -03:00
cewing
65cffbc05c
style fixup per @zupo
2013-10-06 16:21:30 -03:00
cewing
07aeb9a376
fix incorrect username/userid usage
2013-10-06 16:21:02 -03:00
cewing
5d02ec3902
style fix per @zupo
2013-10-06 16:20:06 -03:00
cewing
9a9ce59cee
Make a helper method which asserts that the authenticated user has a
...
different userid and username. This method is used in tests which
demonstrate taking action by username vs. userid to ensure that should
this assumption no longer be valid, we can learn of the fact.
2013-10-06 16:17:32 -03:00
cewing
4a3a250599
style fix per @zupo
2013-10-06 16:14:02 -03:00
cewing
bff8dfb59e
style fixes from comments, thanks @zupo
2013-10-06 15:21:42 -03:00
cewing
ebc1e59616
flake8 and typos
2013-10-06 15:18:22 -03:00
cewing
988c3c99d7
add test that removing a user from a group raises the appropriate error in
...
the case that the user does not exist
2013-10-06 15:07:01 -03:00
cewing
71c9bd19e3
fix test to catch the correct problem
...
fix test to check for the right exception type
2013-10-06 15:07:01 -03:00
cewing
b9ec76986f
ensure that the non-existent user does not raise the wrong error
2013-10-06 15:07:01 -03:00
cewing
791325bde3
treat username as username only, do not alias to userid
...
raise UserNotFoundError if user cannot be found by username
document that this error may be raised
2013-10-06 15:07:01 -03:00
cewing
a9f50097ea
ensure that the username passed is treated exclusively as username, not
...
aliased to userid
raise UserNotFoundError if the provided username cannot get a user
document that this error may be raised
2013-10-06 15:07:01 -03:00
cewing
e9be8ca83e
document that the method may raise UserNotFoundError
2013-10-06 15:07:01 -03:00
cewing
8a297398bf
document the difference between userid and username, and give
...
examples of circumstances where they might differ
fix typo in parameter designation
2013-10-06 15:07:01 -03:00
Fabiano Weimar dos Santos
00b943d2f8
ammed user.get method to accept userid parameter
2013-10-06 15:07:01 -03:00
Nejc Zupan
1380c4fe52
Merge pull request #138 from plone/issue_125
...
added debug_mode() method
2013-10-06 10:27:27 -07:00
Nejc Zupan
f0c62cca47
add pointers to examples in env docstrings
2013-10-05 20:25:00 -03:00
Nejc Zupan
6af94388df
remove whitespace
2013-10-05 20:14:54 -03:00
Simon Delcourt
d3de51e04f
fixed docstring of the method, added doctsring for test
2013-10-05 18:09:17 -03:00
Simon Delcourt
a1d12dd2b4
added documentation
2013-10-05 16:11:30 -03:00
Simon Delcourt
6be1c6b864
added debug_mode() method
2013-10-05 15:29:58 -03:00
Nejc Zupan
05765a5371
Merge pull request #134 from plone/issue_118
...
adding underlying error message
2013-10-05 09:59:24 -07:00
winstonf88
283529fcc8
adding underlying error message
2013-10-05 13:43:39 -03:00
Rodrigo Ferreira de Souza
ab45e266d7
Merge branch 'master' into issue_115
...
Conflicts:
docs/CHANGES.rst
2013-10-05 13:18:10 -03:00
Nejc Zupan
3667c661df
terminate docstrings with a full-stop
2013-09-30 11:17:03 -03:00
Rodrigo Ferreira de Souza
6357f5406c
Fix api.content.copy without target parameter
2013-09-04 15:03:25 -03:00
Adam Cheasley
a0031a56e1
Do not assume we can acquire getLocallyAllowedTypes
...
It seems in some test scenarios getLocallyAllowedTypes is not always available. In this case, instead of raising an AttributeError, raise an InvalidParameterError with a helpful error string.
2013-05-31 12:08:13 +02:00
Kees Hink
5e22051c9f
Adapt imports to case-sensitive sort convention.
2013-05-27 17:19:00 +02:00
Nejc Zupan
2562b5f9c3
pyflakes
2013-04-03 19:45:16 +02:00
Nejc Zupan
131ff1bc07
Merge pull request #98 from pingviini/pingviini-independent-rename
...
Rename is now independent function used by copy and move functions when needed
2013-04-03 10:05:52 -07:00
Nejc Zupan
f79fdc66f6
Fix datetime format in tests.
...
The api.portal.localized_time can return different datetime formats on
different systems, causing test failures on only a subset of machines.
Therefore, before testing the localized_time() method, we set the expected
datetime format portal-wide.
2013-04-03 19:04:50 +02:00