Zope testing django layer

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class DjangoLayer(object):

    @classmethod
    def setUp(self):
        from django.conf import settings
        self.pre_existing_db_name = settings.DATABASE_NAME
        from django.test import utils
        utils.setup_test_environment()
        utils.create_test_db(verbosity=0, autoclobber=True)

    @classmethod
    def tearDown(self):
        from django.test import utils
        utils.destroy_test_db(self.pre_existing_db_name, verbosity=0)
        utils.teardown_test_environment()
    
    @classmethod
    def testTearDown(self):
        from django.core import management
        management.call_command('flush', verbosity=0, interactive=False)

More like this

  1. TestSettingsManager: temporarily change settings for tests by carljm 3 years, 5 months ago
  2. Custom nose runner by tomas 2 years, 8 months ago
  3. Deep package test runner by eternicode 11 months, 1 week ago
  4. Test runner with coverage by nicklane 3 years, 10 months ago
  5. djangopath: conveniently set sys.path and DJANGO_SETTINGS_MODULE by alia_khouri 3 years, 6 months ago

Comments

(Forgotten your password?)