<s> import os <EOL> import sys <EOL> sys . path . insert ( <NUM_LIT:1> , os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" ) ) <EOL> from djangothrift_test_gen . ttypes import TestStruct <EOL> import unittest <EOL> from django_test_util import configure_django_for_test , create_tables <EOL> configure_django_for_test ( ) <EOL> from django . db import models <EOL> from djangothrift import ThriftField <EOL> class ThriftTestModel ( models . Model ) : <EOL> class Meta : <EOL> app_label = "<STR_LIT>" <EOL> my_int = models . IntegerField ( ) <EOL> my_struct = ThriftField ( TestStruct ) <EOL> class TestThriftField ( unittest . TestCase ) : <EOL> def test_store_and_retrieve ( self ) : <EOL> create_tables ( ThriftTestModel ) <EOL> struct = TestStruct ( ) <EOL> struct . a = "<STR_LIT>" <EOL> struct . b = <NUM_LIT> <EOL> x = ThriftTestModel ( ) <EOL> x . my_int = <NUM_LIT:3> <EOL> x . my_struct = struct <EOL> x . save ( ) <EOL> y = ThriftTestModel . objects . all ( ) [ <NUM_LIT:0> ] <EOL> self . assertEqual ( x . my_int , y . my_int ) <EOL> self . assertEqual ( x . my_struct , y . my_struct ) <EOL> y . delete ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
