Created
October 2, 2015 09:43
-
-
Save piotr-dobrogost/34f6df8c35aecdaa23c9 to your computer and use it in GitHub Desktop.
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
Traceback (most recent call last): | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/tests/conftest.py", line 12, in foo_proxy | |
from kotti_content_proxy.resources import ContentProxy | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/__init__.py", line 10, in <module> | |
from .resources import ContentProxy | |
File "/home/piotr/projects/kotti_content_proxy/kotti_content_proxy/resources.py", line 14, in <module> | |
from kotti_content_proxy import _ | |
ImportError: cannot import name _ |
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
import pytest | |
def test_proxying_custom_attributes(foo_proxy): | |
import kotti_content_proxy | |
settings = { | |
'kotti_content_proxy.proxied_attrs': ['some_attribute', | |
'another_attribute'] | |
} | |
kotti_content_proxy.kotti_configure(settings) | |
foo = foo_proxy['foo'] | |
proxy = foo_proxy['proxy'] | |
assert proxy.some_attribute == foo.some_attribute | |
with pytest.raises(AttributeError) as excinfo: | |
proxy.another_attribute | |
assert excinfo.value.message == "'Document' object has no attribute 'another_attribute'" # noqa | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment