Exemplo n.º 1
0
    def test_customized_primary_field(self):
        class ORZFieldTest(object):
            foo_bar = OrzPrimaryField()
            foo = OrzField()
            bar = OrzField()

        field = _initialize_primary_field(ORZFieldTest)
        self.assertTrue(hasattr(ORZFieldTest, 'foo_bar'))
        self.assertEqual(field.field_name, 'foo_bar')
Exemplo n.º 2
0
    def test_customized_primary_field(self):
        class ORZFieldTest(object):
            foo_bar = OrzPrimaryField()
            foo = OrzField()
            bar = OrzField()

        field = _initialize_primary_field(ORZFieldTest)
        self.assertTrue(hasattr(ORZFieldTest, 'foo_bar'))
        self.assertEqual(field.field_name, 'foo_bar')
Exemplo n.º 3
0
    def test_basic_primary_field(self):
        class ORZFieldTest(object):
            foo = OrzField()
            bar = OrzField()
        self.klass = ORZFieldTest

        field = _initialize_primary_field(self.klass)
        self.assertTrue(hasattr(self.klass, 'id'))
        self.assertEqual(field.field_name, 'id')
Exemplo n.º 4
0
    def test_basic_primary_field(self):
        class ORZFieldTest(object):
            foo = OrzField()
            bar = OrzField()

        self.klass = ORZFieldTest

        field = _initialize_primary_field(self.klass)
        self.assertTrue(hasattr(self.klass, 'id'))
        self.assertEqual(field.field_name, 'id')