<s> """<STR_LIT>""" <EOL> from django . db import models <EOL> from django . test import TestCase <EOL> from django_any import any_model <EOL> class RelatedModel ( models . Model ) : <EOL> name = models . CharField ( max_length = <NUM_LIT:5> ) <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> class BaseModel ( models . Model ) : <EOL> related = models . ForeignKey ( RelatedModel ) <EOL> class Meta : <EOL> app_label = '<STR_LIT>' <EOL> class ForeignKeyCreation ( TestCase ) : <EOL> def test_fk_relation_autocreate ( self ) : <EOL> result = any_model ( BaseModel ) <EOL> self . assertEqual ( type ( result ) , BaseModel ) <EOL> self . assertEqual ( type ( result . related ) , RelatedModel ) <EOL> self . assertTrue ( result . related . name is not None ) <EOL> def test_nested_models_specification ( self ) : <EOL> result = any_model ( BaseModel , related__name = '<STR_LIT:test>' ) <EOL> self . assertEqual ( result . related . name , '<STR_LIT:test>' ) </s>
