Beispiel #1
0
class LongPropertyTestCase(GraphPropertyBaseClassTestCase):
    klass = Long
    good_cases = (long_(1), long_(0), None)
    bad_cases = ('', 'a', 1.1, [], [1], {}, {'a': 1})
Beispiel #2
0
 def to_python(self, value):
     if value is not None:
         try:
             return int(value)
         except:
             return long_(value)
Beispiel #3
0
 def to_database(self, value):
     value = super(Integer, self).to_database(value)
     if value is not None:
         return long_(value)
Beispiel #4
0
 def to_python(self, value):
     if value is not None:
         return long_(value)