#NEWLINE# def test_liveserver( self ) : #NEWLINE# #INDENT# '\n        Ensure that the --liveserver option sets the environment variable\n        correctly.\n        Refs #2879.\n        ' #NEWLINE# address_predefined = ( 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os . environ ) #NEWLINE# old_address = os . environ . get ( 'DJANGO_LIVE_TEST_SERVER_ADDRESS' ) #NEWLINE# self . cmd . handle ( verbosity = 0 , testrunner = 'regressiontests.admin_scripts.tests.CustomTestRunner' ) #NEWLINE# self . assertEqual ( ( 'DJANGO_LIVE_TEST_SERVER_ADDRESS' in os . environ ) , address_predefined ) #NEWLINE# self . assertEqual ( os . environ . get ( 'DJANGO_LIVE_TEST_SERVER_ADDRESS' ) , old_address ) #NEWLINE# self . cmd . handle ( verbosity = 0 , testrunner = 'regressiontests.admin_scripts.tests.CustomTestRunner' , liveserver = 'blah' ) #NEWLINE# self . assertEqual ( os . environ [ 'DJANGO_LIVE_TEST_SERVER_ADDRESS' ] , 'blah' ) #NEWLINE# if address_predefined : #NEWLINE# #INDENT# os . environ [ 'DJANGO_LIVE_TEST_SERVER_ADDRESS' ] = old_address #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# del os . environ [ 'DJANGO_LIVE_TEST_SERVER_ADDRESS' ]