Hi all,

im using django 1.2

i have override  run_tests method to do unit tests,,,

i dont want django to create test_db for testing, instead should use the
main database

here is the run_tests code:

class Custom_TestSuiteRunner(DjangoTestSuiteRunner):

   def run_tests(self, test_labels, extra_tests=None, **kwargs):

      self.setup_test_environment()
      suite = self.build_suite(test_labels, extra_tests)
      #old_config = self.setup_databases()         #commented to use main
database

      for label in suite:
         test_desc = label.__doc__
         test_name = label
         print "Running test \"%s\"" %test_name
         result = unittest.TextTestRunner(verbosity=0).run(label)

      #self.teardown_databases(old_config)    #commented to use main
database
      self.teardown_test_environment()
      return self.suite_result(suite, result)

when i give command "./manage.py test" following error occurs,,,

ERROR: test_basic_multiplication (xxx..xxx.SimpleTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/build/toolchain/noarch/django-1.2/lib/python2.6/site-packages/django/test/testcases.py",
line 256, in __call__
    self._pre_setup()
  File
"/build/toolchain/noarch/django-1.2/lib/python2.6/site-packages/django/test/testcases.py",
line 223, in _pre_setup
    self._fixture_setup()
  File
"/build/toolchain/noarch/django-1.2/lib/python2.6/site-packages/django/test/testcases.py",
line 486, in _fixture_setup
    if not connections_support_transactions():
  File
"/build/toolchain/noarch/django-1.2/lib/python2.6/site-packages/django/test/testcases.py",
line 475, in connections_support_transactions
    for conn in connections.all())
  File
"/build/toolchain/noarch/django-1.2/lib/python2.6/site-packages/django/test/testcases.py",
line 475, in <genexpr>
    for conn in connections.all())
KeyError: '*SUPPORTS_TRANSACTIONS*'

----------------------------------------------------------------------
Ran 0 tests in 0.000s

FAILED (errors=1)

what would be the reason,,?

i also mentioned *SUPPORTS_TRANSACTIONS = False *in settings.py file,,but
also the error is appearing,,


-- 
Girish M S

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to