test/unittest_rset.py
changeset 572 9849fed789c9
parent 0 b97547f5f1fa
child 631 99f5852f8604
--- a/test/unittest_rset.py	Wed Feb 11 12:17:44 2009 +0100
+++ b/test/unittest_rset.py	Wed Feb 11 13:51:06 2009 +0100
@@ -300,7 +300,13 @@
             attr = etype == 'Bookmark' and 'title' or 'name'
             self.assertEquals(entity[attr], n)
         
-    
+    def test_related_entity_optional(self):
+        e = self.add_entity('Bookmark', title=u'aaaa', path=u'path')
+        rset = self.execute('Any B,U,L WHERE B bookmarked_by U?, U login L')
+        entity, rtype = rset.related_entity(0, 2)
+        self.assertEquals(entity, None)
+        self.assertEquals(rtype, None)
+        
     def test_related_entity_union_subquery(self):
         e = self.add_entity('Bookmark', title=u'aaaa', path=u'path')
         rset = self.execute('Any X,N ORDERBY N WITH X,N BEING '