コード例 #1
0
#!/usr/bin/env python

# use this script to test django non-application tests without running all tests

import unittest
import os

# this setting is required before loading the eulcore.django import
os.environ['DJANGO_SETTINGS_MODULE'] = 'django_tester.settings' 
#from eulcore.django.non_app_tests import *
from testcore import tests_from_modules
from test_django import run_django_tests, non_app_tests

if __name__ == '__main__':
    # sort of cheating here: run only http tests (because it is short)
    # then use extras to run the tests we actually want here
    run_django_tests([__file__, 'http'], extras=non_app_tests())
コード例 #2
0
#!/usr/bin/env python

import os
import unittest
import logging.config

from testcore import tests_from_modules
from test_django import run_django_tests

# anybody who references django needs this before loading
os.environ["DJANGO_SETTINGS_MODULE"] = "django_tester.settings"

# add any non-django modules to be tested here
non_django_test_modules = ("test_binfile", "test_existdb", "test_fedora", "test_xmlmap", "test_xpath")


def non_django_tests():
    return tests_from_modules(non_django_test_modules)


if __name__ == "__main__":
    test_dir = os.path.dirname(os.path.abspath(__file__))
    LOGGING_CONF = os.path.join(test_dir, "logging.conf")
    if os.path.exists(LOGGING_CONF):
        logging.config.fileConfig(LOGGING_CONF)

    run_django_tests(extras=non_django_tests())