Ticket #408 (closed defect: fixed)

Opened 6 years ago

Last modified 6 years ago

south breaks manage.py test

Reported by: harm.verhagen Owned by: andrew
Priority: major Milestone: 0.7.1
Component: commands Version: 0.7
Keywords: Cc:


Hi found that using south 0.7, my unit tests start to fail.

Somehow the unittest of south influences the database.

The south unit test itself works fine.
python manage.py test south is OK
python manage.py test <mycomponent> is OK for all of <mycomponents>

However when testing all in one run stuff fails.

My project does have migrations

The error indicates some left overs from the south unit tests

steps to reproduce

issue python manage.ph test command

actual result

ERROR: test_bla (epsso_embed.tests.SimpleTest)
Traceback (most recent call last):
  File "/home/harm/svn/idq/trunk/projects/idqsso/django/apps/epsso_embed/tests.py", line 52, in test_bla
    connect_user(user_exist, user_tmp)
  File "/home/harm/svn/idq/trunk/projects/idqsso/django/apps/epsso_account/utils.py", line 80, in connect_user
  File "/opt/python2.5/src/django/django/db/models/base.py", line 601, in delete
  File "/opt/python2.5/src/django/django/db/models/base.py", line 576, in _collect_sub_objects
    for sub_obj in delete_qs:
  File "/opt/python2.5/src/django/django/db/models/query.py", line 104, in _result_iter
  File "/opt/python2.5/src/django/django/db/models/query.py", line 755, in _fill_cache
  File "/opt/python2.5/src/django/django/db/models/query.py", line 267, in iterator
    for row in compiler.results_iter():
  File "/opt/python2.5/src/django/django/db/models/sql/compiler.py", line 685, in results_iter
    for rows in self.execute_sql(MULTI):
  File "/opt/python2.5/src/django/django/db/models/sql/compiler.py", line 740, in execute_sql
    cursor.execute(sql, params)
  File "/opt/python2.5/src/django/django/db/backends/mysql/base.py", line 86, in execute
    return self.cursor.execute(query, args)
  File "/opt/python2.5/lib/python2.5/site-packages/MySQLdb/cursors.py", line 173, in execute
    self.errorhandler(self, exc, value)
  File "/opt/python2.5/lib/python2.5/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
    raise errorclass, errorvalue
DatabaseError: (1146, "Table 'test_idq_harm.my_fave' doesn't exist")

expected result

south tests don't influence project testsuite.
All tests pass.

version =


Change History

comment:1 Changed 6 years ago by andrew

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to 0.7.1

Yes, the South test suite can potentially interfere with other apps - it's designed to be run on its own. The most recent trunk versions have south tests disabled by default; you can do this manually by setting SKIP_SOUTH_TESTS = True.

Note: See TracTickets for help on using tickets.