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. Custom nose runner by tomas 3 years, 11 months ago
  2. Continuous Integration command by berto 3 years, 7 months ago
  3. Syntax highlighting for tracebacks during tests by jezdez 9 months ago
  4. Exclude Apps When Testing by cronosa 2 years, 7 months ago
  5. djangopath: conveniently set sys.path and DJANGO_SETTINGS_MODULE by alia_khouri 4 years, 9 months ago

Comments

(Forgotten your password?)