Django SQLite Test Honesty: Different Execution Paths?

This is just a theory that I would like to find out on the basis of other reviews and, possibly, similar experiments.

I used mySQL to run the tests, but of course the in-memory SQLite database is much faster. However, he seems to be having some problems.

When DATABASE_ENGINEset to django.db.backends.sqlite3, and I run manage.py test, the output is not so reliable:

(Most of the lines have been deleted, but interesting points of failure have been indicated)

$ python manage.py test
Traceback (most recent call last):
  File "manage.py", line 12, in 
    execute_manager (settings)
  File "/Users/bartekc/.virtualenvs/xx/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
    utility.execute ()
  File "/Users/bartekc/domains/xx/xx/associates/yy/models.py", line 51, in 
    class AcvTripIncentive (models.Model):

  # First interesting failure
  File "/Users/bartekc/domains/xx/xx/associates/yy/models.py", line 55, in AcvTripIncentive
    trip = models.OneToOneField (Trip, limit_choices_to = {'sites': Site.objects.get (name = 'ZZ'), 'is_active': True,})

  # Next interesting failure
   File "/Users/bartekc/domains/xx/xx/associates/yyz/models.py", line 252, in 
    current_site = Site.objects.get_current ()

There are a few glitches like this, but just pointing a couple. The problem is obvious. The site model does not have actual data, but the files contain code that tries to extract current or specific instances within the site model.

: OneToOneField limit_choices_to, - . , Django.

: SQLite, mySQL?. , ? , Python .

?

.

+5
2

- , mocking ? UT , ( , ) . , unit test.

+1
0

All Articles