def run(self): """ Run the database seeds. """ theaters = factory(Theater, 10).create() for theater in theaters: screen_count = random.choice(ran_range) while screen_count > 0: theater.screens().save(factory(Screen).make()) screen_count -= 1
def test_view_should_return_a_json_response_when_returning_length_aware_paginator_instance( self): users = User.all() # Page 1 (self.get('/paginate').assertHasJson( 'total', len(users)).assertHasJson('count', 10).assertHasJson( 'per_page', 10).assertHasJson('current_page', 1).assertHasJson('from', 1).assertHasJson('to', 10)) # Page 2 (self.get('/paginate', { 'page': 2 }).assertHasJson('total', len(users)).assertHasJson( 'count', 10).assertHasJson('per_page', 10).assertHasJson( 'current_page', 2).assertHasJson('from', 11).assertHasJson('to', 20)) factory(User).create() (self.get('/length_aware').assertHasJson('total', 1).assertHasJson('count', 1))
def run(self): """ Run the database seeds. """ factory(Post, 75).create()
def run(self): """ Run the database seeds. """ factory(User, 50).create()
def setUpFactories(self): """This runs when the test class first starts up. This does not run before every test case. """ factory(User, 1).create()
def setUpFactories(self): factory(User, 50).create()
def run(self): """Run the database seeds.""" factory(Entry, 25).create()
def run(self): """ Run the database seeds. """ movies = factory(Movie, 10).create()
def run(self): """ Run the database seeds. """ factory(Member, 10).create()
def run(self): factory(Project, 50).create()