def build_suite(app_module):
 suite = unittest.TestSuite()
 if hasattr(app_module, 'suite'):
  suite.addTest(app_module.suite())
 else:
  suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(app_module))
  try:
   suite.addTest(doctest.DocTestSuite(app_module, checker=doctestOutputChecker, runner=DocTestRunner))
  except ValueError:
   pass
 test_module = get_tests(app_module)
 if test_module:
  if hasattr(test_module, 'suite'):
   suite.addTest(test_module.suite())
  else:
   suite.addTest(unittest.defaultTestLoader.loadTestsFromModule(test_module))
   try:
    suite.addTest(doctest.DocTestSuite(test_module, checker=doctestOutputChecker, runner=DocTestRunner))
   except ValueError:
    pass
 return suite

def build_suite ( app_module ) : suite = unittest . TestSuite ( ) if hasattr ( app_module , 'suite' ) : suite . addTest ( app_module . suite ( ) ) else : suite . addTest ( unittest . defaultTestLoader . loadTestsFromModule ( app_module ) ) try : suite . addTest ( doctest . DocTestSuite ( app_module , checker = doctestOutputChecker , runner = DocTestRunner ) ) except ValueError : pass test_module = get_tests ( app_module ) if test_module : if hasattr ( test_module , 'suite' ) : suite . addTest ( test_module . suite ( ) ) else : suite . addTest ( unittest . defaultTestLoader . loadTestsFromModule ( test_module ) ) try : suite . addTest ( doctest . DocTestSuite ( test_module , checker = doctestOutputChecker , runner = DocTestRunner ) ) except ValueError : pass return suite
create a complete django test suite for the provided application module .