Skip to content

Commit

Permalink
fix doctest to respect new python dunder repr
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Feb 8, 2019
1 parent ce411f5 commit 7608888
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/z3c/relationfield/README.rst
Expand Up @@ -331,7 +331,7 @@ Let's ask the catalog about the relation from ``b`` to ``a``:
>>> l = sorted(catalog.findRelations({'to_id': intids.getId(root['a'])}))
>>> l
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
We look at this relation object again. We indeed go the right one:

Expand Down Expand Up @@ -369,7 +369,7 @@ interface ``IItem``:
... 'from_attribute': 'rel',
... 'from_interfaces_flattened': IItem,
... 'to_interfaces_flattened': IItem}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
There are no relations stored for another attribute:

Expand Down Expand Up @@ -416,7 +416,7 @@ We currently have a relation from ``b`` to ``a``:
.. code-block:: python
>>> sorted(catalog.findRelations({'to_id': intids.getId(root['a'])}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
We can change the relation to point at a new object ``c``:

Expand All @@ -438,7 +438,7 @@ We should find now a single relation from ``b`` to ``c``:
.. code-block:: python
>>> sorted(catalog.findRelations({'to_id': c_id}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
The relation to ``a`` should now be gone:

Expand All @@ -456,12 +456,12 @@ the ObjectModifiedEvent.
>>> from z3c.relationfield.event import _setRelation
>>> _setRelation(root['b'], 'my-fancy-relation', rel_to_a)
>>> sorted(catalog.findRelations({'to_id': intids.getId(root['a'])}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
>>> notify(ObjectModifiedEvent(root['b']))
>>> rel = sorted(catalog.findRelations({'to_id': intids.getId(root['a'])}))
>>> rel
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
>>> catalog.unindex(rel[0])
Expand All @@ -473,7 +473,7 @@ We have a relation from ``b`` to ``c`` right now:
.. code-block:: python
>>> sorted(catalog.findRelations({'to_id': c_id}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
We can clean up an existing relation from ``b`` to ``c`` by setting it
to ``None``:
Expand Down Expand Up @@ -505,7 +505,7 @@ Let's reestablish the removed relation:
>>> notify(ObjectModifiedEvent(root['b']))
>>> sorted(catalog.findRelations({'to_id': c_id}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
Copying an object with relations
Expand Down Expand Up @@ -583,7 +583,7 @@ We have a relation from ``b`` to ``c`` right now:
.. code-block:: python
>>> sorted(catalog.findRelations({'to_id': c_id}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
We have no broken relations:

Expand Down Expand Up @@ -647,7 +647,7 @@ We can however find it by searching for relations that have a
.. code-block:: python
>>> sorted(catalog.findRelations({'to_id': None}))
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
A broken relation isn't equal to ``None`` (this was a bug):

Expand Down Expand Up @@ -699,7 +699,7 @@ We can query for this relation now:
>>> l = sorted(catalog.findRelations({'to_id': some_object_id}))
>>> l
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
RelationList
============
Expand Down Expand Up @@ -805,7 +805,7 @@ We can see the real relation object now:
.. code-block:: python
>>> root['d'].rel
<RelationValue object at ...>
<...RelationValue object at ...>
The relation will also now show up in the catalog:

Expand Down Expand Up @@ -834,7 +834,7 @@ Again we can see the real relation object when we look at it:
.. code-block:: python
>>> root['multi_temp'].rel
[<RelationValue object at ...>]
[<...RelationValue object at ...>]
And we will now see this new relation appear in the catalog:

Expand Down

0 comments on commit 7608888

Please sign in to comment.