~cr3/launchpad-results/trunk

« back to all changes in this revision

Viewing changes to launchpadresults/database/enum.py

  • Committer: Marc Tardif
  • Date: 2010-09-23 23:40:07 UTC
  • Revision ID: marc.tardif@canonical.com-20100923234007-kxouzhvgv613957k
Added testing layers and factories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
from storm.properties import SimpleProperty
5
5
from storm.variables import Variable
6
6
 
7
 
from zope.security.proxy import isinstance as zope_isinstance
8
 
 
9
7
from lazr.enum import (
10
8
    DBEnumeratedType,
11
9
    DBItem,
33
31
        if from_db:
34
32
            return self._enum.items[value]
35
33
        else:
36
 
            if not zope_isinstance(value, DBItem):
 
34
            if not isinstance(value, DBItem):
37
35
                raise TypeError("Not a DBItem: %r" % (value,))
38
36
            if self._enum != value.enum:
39
37
                raise TypeError("DBItem from wrong type, %r != %r" % (