Opened 17 years ago

Closed 17 years ago

#5399 closed (duplicate)

Error in test suite, modeltests.fixtures.models.__test__.API_TESTS

Reported by: Ludovico Magnocavallo <ludo@…> Owned by: Michael Radziej
Component: Testing framework Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When running the test suite against [6094] using MySQL 5.0 on a pretty stock Ubuntu feisty system, I get an error in tests/modeltests/fixtures/models.py. The same error is not present if I switch the backend to sqlite3.

Here is the dump of the error messages

======================================================================
FAIL: Doctest: modeltests.fixtures.models.__test__.API_TESTS
----------------------------------------------------------------------
Traceback (most recent call last):
  File "django/test/_doctest.py", line 2161, in runTest
AssertionError: Failed doctest test for modeltests.fixtures.models.__test__.API_TESTS
  File "/home/ludo/Desktop/dev/django-tests/modeltests/fixtures/models.py", line unknown line number, in API_TESTS

----------------------------------------------------------------------
File "/home/ludo/Desktop/dev/django-tests/modeltests/fixtures/models.py", line ?, in modeltests.fixtures.models.__test__.API_TESTS
Failed example:
    Article.objects.all()
Expected:
    [<Article: Time to reform copyright>, <Article: Poker has no place on ESPN>, <Article: Python program becomes self aware>]
Got:
    [<Article: XML identified as leading cause of cancer>, <Article: Time to reform copyright>, <Article: Poker on TV is great!>, <Article: Python program becomes self aware>]
----------------------------------------------------------------------
File "/home/ludo/Desktop/dev/django-tests/modeltests/fixtures/models.py", line ?, in modeltests.fixtures.models.__test__.API_TESTS
Failed example:
    management.call_command('dumpdata', 'fixtures', format='json')
Expected:
    [{"pk": "3", "model": "fixtures.article", "fields": {"headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00"}}, {"pk": "2", "model": "fixtures.article", "fields": {"headline": "Poker has no place on ESPN", "pub_date": "2006-06-16 12:00:00"}}, {"pk": "1", "model": "fixtures.article", "fields": {"headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00"}}]
Got:
    [{"pk": "5", "model": "fixtures.article", "fields": {"headline": "XML identified as leading cause of cancer", "pub_date": "2006-06-16 16:00:00"}}, {"pk": "3", "model": "fixtures.article", "fields": {"headline": "Time to reform copyright", "pub_date": "2006-06-16 13:00:00"}}, {"pk": "2", "model": "fixtures.article", "fields": {"headline": "Poker on TV is great!", "pub_date": "2006-06-16 11:00:00"}}, {"pk": "1", "model": "fixtures.article", "fields": {"headline": "Python program becomes self aware", "pub_date": "2006-06-16 11:00:00"}}]


----------------------------------------------------------------------
Ran 160 tests in 124.687s

FAILED (failures=1)

Change History (3)

comment:1 by mir@…, 17 years ago

Owner: changed from nobody to anonymous
Status: newassigned

This is a known limitation of the fixture framework: It does not (and cannot) work with MySQL. The fundamental problem is that MySQL does not check foreign key constraints at commit time, but at row insertion time (against SQL standards).

Anyway, it's bad when self tests break, I'm going to ask at the developers list for the policy.

comment:2 by mir@…, 17 years ago

Owner: changed from anonymous to Michael Radziej
Status: assignednew

Learned that I have to log in to accept ticket

comment:3 by Russell Keith-Magee, 17 years ago

Resolution: duplicate
Status: newclosed

This is a duplicate of #4788.

Note: See TracTickets for help on using tickets.
Back to Top