<s> import factory <EOL> from api . models import App , OpenDevelopUser <EOL> from random import choice <EOL> from string import digits , letters <EOL> def random_string ( x ) : <EOL> return '<STR_LIT>' . join ( choice ( digits + letters ) for x in range ( x ) ) <EOL> def prefix_seq ( x ) : <EOL> return lambda n : x + '<STR_LIT>' . format ( n ) <EOL> class OpenDevelopUserFactory ( factory . DjangoModelFactory ) : <EOL> FACTORY_FOR = OpenDevelopUser <EOL> username = factory . Sequence ( prefix_seq ( '<STR_LIT:username>' ) ) <EOL> email = factory . Sequence ( prefix_seq ( '<STR_LIT:email>' ) ) <EOL> class AppFactory ( factory . DjangoModelFactory ) : <EOL> FACTORY_FOR = App <EOL> client_id = factory . Sequence ( lambda self : random_string ( <NUM_LIT:20> ) ) <EOL> client_secret = factory . Sequence ( lambda self : random_string ( <NUM_LIT> ) ) <EOL> owner = factory . SubFactory ( OpenDevelopUserFactory ) </s>
