コード例 #1
0
ファイル: test_humble.py プロジェクト: thrawn01/humble
    def testCreate(self):
        # Tell Humble about our table without having to define it
        humble = Humble( self.db )

        # Create a new row object to manipulate
        employee = humble.create( 'employee' )

        # Normal Assignment
        employee.first = "Derrick"
        employee.last = "Wippler"

        employee.save()

        # Get the employee record
        employee = humble.get( 'employee', 1 )

        self.assertEquals( employee.first, 'Derrick' )
        self.assertEquals( employee.last, 'Wippler' )

        # Since we didn't define these values, they are empty
        self.assertEquals( employee.age, None )
        self.assertEquals( employee.address, None )
        return humble