#NEWLINE# def prepare_test_runner( * args , **kwargs ) : #NEWLINE# #INDENT# '\n    Configures a test runner based on Django version to\n    maintain backward compatibility.\n    ' #NEWLINE# import django #NEWLINE# test_runner = None #NEWLINE# if django_17 ( ) : #NEWLINE# #INDENT# django . setup ( ) #NEWLINE# from django.test.runner import DiscoverRunner #NEWLINE# test_runner = DiscoverRunner ( pattern = 'test*.py' , verbosity = kwargs . get ( 'verbosity' , 1 ) , interactive = kwargs . get ( 'interactive' , False ) , failfast = kwargs . get ( 'failfast' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# from django.test.simple import DjangoTestSuiteRunner #NEWLINE# test_runner = DjangoTestSuiteRunner ( verbosity = kwargs . get ( 'verbosity' , 1 ) , interactive = kwargs . get ( 'interactive' , False ) , failfast = kwargs . get ( 'failfast' ) ) #NEWLINE# #UNINDENT# return test_runner