doc/book/en/devrepo/testing.rst
branchstable
changeset 6344 0cb0d8d83e4c
parent 6301 d9d6bdd814ba
child 6471 6e0642346f80
--- a/doc/book/en/devrepo/testing.rst	Fri Sep 24 18:37:03 2010 +0200
+++ b/doc/book/en/devrepo/testing.rst	Fri Sep 24 18:38:24 2010 +0200
@@ -42,6 +42,8 @@
   `sync_schema_props_perms()` fonction of the migration environment
   need not a database regeneration step.
 
+.. _hook_test:
+
 Unit test by example
 ````````````````````
 
@@ -85,6 +87,14 @@
 The test case itself checks that an Operation does it job of
 preventing cycles amongst Keyword entities.
 
+`create_entity` is a useful method, which easily allows to create an
+entity. You can link this entity to others entities, by specifying as
+argument, the relation name, and the entity to link, as value. In the
+above example, the `Classification` entity is linked to a `CWEtype`
+via the relation `classifies`. Conversely, if you are creating a
+`CWEtype` entity, you can link it to a `Classification` entity, by
+adding `reverse_classifies` as argument.
+
 .. note::
 
    :meth:`commit` method is not called automatically in test_XXX