~cr3/storm/reference_is_in

« back to all changes in this revision

Viewing changes to tests/store/base.py

  • Committer: Marc Tardif
  • Date: 2009-06-01 20:58:33 UTC
  • Revision ID: marc.tardif@canonical.com-20090601205833-0v9jpdbiadjepzib
Fixed is_in method in references to support compound key references and added test when passed an empty list.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2974
2974
        self.assertEquals(result.count(), 2)
2975
2975
        self.assertEquals([100, 200], sorted(bar.id for bar in result))
2976
2976
 
 
2977
    def test_reference_is_in_with_empty(self):
 
2978
        result = self.store.find(Bar, Bar.foo.is_in([]))
 
2979
        self.assertEquals(result.count(), 0)
 
2980
 
2977
2981
    def test_reference_self(self):
2978
2982
        selfref = self.store.add(SelfRef())
2979
2983
        selfref.id = 400