equal
deleted
inserted
replaced
99 |
99 |
100 def test_related_cache_both(self): |
100 def test_related_cache_both(self): |
101 user = self.entity('Any X WHERE X eid %(x)s', {'x':self.user().eid}, 'x') |
101 user = self.entity('Any X WHERE X eid %(x)s', {'x':self.user().eid}, 'x') |
102 adeleid = self.execute('INSERT EmailAddress X: X address "toto@logilab.org", U use_email X WHERE U login "admin"')[0][0] |
102 adeleid = self.execute('INSERT EmailAddress X: X address "toto@logilab.org", U use_email X WHERE U login "admin"')[0][0] |
103 self.commit() |
103 self.commit() |
104 self.assertEquals(user._related_cache.keys(), []) |
104 self.assertEquals(user._related_cache, {}) |
105 email = user.primary_email[0] |
105 email = user.primary_email[0] |
106 self.assertEquals(sorted(user._related_cache), ['primary_email_subject']) |
106 self.assertEquals(sorted(user._related_cache), ['primary_email_subject']) |
107 self.assertEquals(email._related_cache.keys(), ['primary_email_object']) |
107 self.assertEquals(email._related_cache.keys(), ['primary_email_object']) |
108 groups = user.in_group |
108 groups = user.in_group |
109 self.assertEquals(sorted(user._related_cache), ['in_group_subject', 'primary_email_subject']) |
109 self.assertEquals(sorted(user._related_cache), ['in_group_subject', 'primary_email_subject']) |