Opened 16 years ago
Closed 16 years ago
#8196 closed (fixed)
modeltests/model_forms tests fail on a system without PIL installed
Reported by: | Ramiro Morales | Owned by: | Marty Alchin |
---|---|---|---|
Component: | Testing framework | Version: | dev |
Severity: | Keywords: | ||
Cc: | richard.davies@… | Triage Stage: | Accepted |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
This is the output (Linux + Python 2.4.4):
====================================================================== FAIL: Doctest: modeltests.model_forms.models.__test__.API_TESTS ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/ramiro/hg-repos/django/trunk/django/test/_doctest.py", line 2180, in runTest raise self.failureException(self.format_failure(new.getvalue())) AssertionError: Failed doctest test for modeltests.model_forms.models.__test__.API_TESTS File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line unknown line number, in API_TESTS ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test.png> Got: <FieldFile: tests/test.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test.png> Got: <FieldFile: tests/test.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: f.cleaned_data['image'] Expected: <ImageFieldFile: tests/test.png> Got: <FieldFile: tests/test.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test.png> Got: <FieldFile: tests/test.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test2.png> Got: <FieldFile: tests/test2.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test2.png> Got: <FieldFile: tests/test2.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: None> Got: <FieldFile: None> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test3.png> Got: <FieldFile: tests/test3.png> ---------------------------------------------------------------------- File "/home/ramiro/hg-repos/django/trunk/tests/modeltests/model_forms/models.py", line ?, in modeltests.model_forms.models.__test__.API_TESTS Failed example: instance.image Expected: <ImageFieldFile: tests/test3.png> Got: <FieldFile: tests/test3.png>
Also tested on a Windows system + Python 2.5.2 (see http://dpaste.com/70381/)
Attachments (2)
Change History (6)
comment:1 by , 16 years ago
Component: | Uncategorized → Unit test system |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 16 years ago
Attachment: | 8196-r8425.diff added |
---|
Replaces ImageFieldFile
with ...FieldFile
so it doesn't care whether it's an image or not
comment:3 by , 16 years ago
Cc: | added |
---|---|
Has patch: | set |
As noted on the DjangoOnWindows page, this is one of only two tests failing under Windows (XP 32 bits) + official Python 2.5.2.
[Also note that Gulopine added a patch]
by , 16 years ago
Attachment: | 8196-r8757.diff added |
---|
Updated patch so it still applies cleanly to r8757
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note:
See TracTickets
for help on using tickets.
Tests in there assume that PIL is installed. How does one usually test against different situations in a doctest?