<s> from lettuce import before , after , world <EOL> from splinter . browser import Browser <EOL> from django . test . utils import setup_test_environment , teardown_test_environment <EOL> from django . core . management import call_command <EOL> from django . db import connection <EOL> from django . conf import settings <EOL> @ before . harvest <EOL> def initial_setup ( server ) : <EOL> call_command ( '<STR_LIT>' , interactive = False , verbosity = <NUM_LIT:0> ) <EOL> call_command ( '<STR_LIT>' , interactive = False , verbosity = <NUM_LIT:0> ) <EOL> call_command ( '<STR_LIT>' , interactive = False , verbosity = <NUM_LIT:0> ) <EOL> call_command ( '<STR_LIT>' , '<STR_LIT:all>' , verbosity = <NUM_LIT:0> ) <EOL> setup_test_environment ( ) <EOL> world . browser = Browser ( '<STR_LIT>' ) <EOL> @ after . harvest <EOL> def cleanup ( server ) : <EOL> connection . creation . destroy_test_db ( settings . DATABASES [ '<STR_LIT:default>' ] [ '<STR_LIT>' ] ) <EOL> teardown_test_environment ( ) <EOL> @ before . each_scenario <EOL> def reset_data ( scenario ) : <EOL> call_command ( '<STR_LIT>' , interactive = False , verbosity = <NUM_LIT:0> ) <EOL> call_command ( '<STR_LIT>' , '<STR_LIT:all>' , verbosity = <NUM_LIT:0> ) <EOL> @ after . all <EOL> def teardown_browser ( total ) : <EOL> world . browser . quit ( ) </s>
