示例#1
0
文件: test.py 项目: lafada/kalapy
    def execute(self, options, args):

        dbname = settings.DATABASE_NAME
        if settings.DATABASE_ENGINE == 'sqlite3':
            dbname = os.path.basename(dbname)
        if dbname and not dbname.lower().startswith('test_'):
            self.error("Invalid database %r, test database name must start with 'test_'" % dbname)

        args = args or self.packages_with_tests()

        if not args:
            raise self.error('No package installed yet.')

        # sync database tables
        execute_command(['database', 'sync'])

        run_tests(args, 2 if options.verbose else 0)
示例#2
0
    def execute(self, options, args):

        dbname = settings.DATABASE_NAME
        if settings.DATABASE_ENGINE == 'sqlite3':
            dbname = os.path.basename(dbname)
        if dbname and not dbname.lower().startswith('test_'):
            self.error(
                "Invalid database %r, test database name must start with 'test_'"
                % dbname)

        args = args or self.packages_with_tests()

        if not args:
            raise self.error('No package installed yet.')

        # sync database tables
        execute_command(['database', 'sync'])

        run_tests(args, 2 if options.verbose else 0)
示例#3
0
#!/usr/bin/env python
from kalapy import admin
try:
    import settings
except ImportError:
    settings = None

if __name__ == "__main__":
    admin.execute_command(None, settings)

示例#4
0
#!/usr/bin/env python
import os, sys
from os.path import dirname, abspath

from kalapy import admin

if abspath(os.curdir) != abspath(dirname(__file__)):
    print "Error: The admin script should be run from the project dir."
    sys.exit(1)

try:
    import settings
except ImportError:
    print "Error: Can't find 'settings.py'"
    sys.exit(1)

if __name__ == "__main__":
    admin.execute_command(None, settings)
示例#5
0
文件: db.py 项目: lafada/kalapy
 def tearDown(self):
     if settings.DATABASE_ENGINE == 'gae':
         from kalapy.admin import execute_command
         execute_command(['database', 'clear', '-f'])
     else:
         database.rollback()
示例#6
0
#!/usr/bin/env python
import sys
from kalapy import admin

if __name__ == "__main__":
    args = ['project'] + sys.argv[1:]
    admin.execute_command(args)