#21551 closed Bug (fixed)
1.6 regression: Can't load fixtures from subdir
| Reported by: | Jonas H. | Owned by: | nobody |
|---|---|---|---|
| Component: | Core (Management commands) | Version: | 1.6 |
| Severity: | Release blocker | Keywords: | loaddata, fixtures |
| Cc: | jonas-django@… | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Consider this fixture directory (added to FIXTURE_DIRS):
- fixtures/
+ initial_data.json
+ tests/
- initial_data_inner.json
Loading the outer fixture works:
$ ./manage.py loaddata initial_data Installed 3 object(s) from 1 fixture(s)
The inner does not:
$ ./manage.py loaddata initial_data_inner
…site-packages/django/core/management/commands/loaddata.py:218: UserWarning: No fixture named 'initial_data_inner' found.
warnings.warn("No fixture named '%s' found." % fixture_name)
Installed 0 object(s) from 0 fixture(s)
$ ./manage.py loaddata tests/initial_data_inner
…site-packages/django/core/management/commands/loaddata.py:218: UserWarning: No fixture named 'initial_data_inner' found.
warnings.warn("No fixture named '%s' found." % fixture_name)
Installed 0 object(s) from 0 fixture(s)
This used to work in Django 1.5.
The cause of this is that all fixture names that contain an os.path.sep are considered absolute paths in the loaddata management command.
Change History (5)
comment:1 by , 12 years ago
| Severity: | Normal → Release blocker |
|---|
comment:2 by , 12 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
comment:3 by , 12 years ago
| Has patch: | set |
|---|
https://github.com/django/django/pull/2036
This issue is partially related to #20933.
comment:4 by , 12 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Marking as a release blocker since it's a regression.