Code

Ticket #18213: ticket18213.diff

File ticket18213.diff, 1.0 KB (added by renatooliveira, 22 months ago)

I just removed the test. But, if the best way is to create a setting to disable it whenever you want, how would it be?

Line 
1diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
2index 34f8041..9fd2e25 100644
3--- a/django/core/management/commands/loaddata.py
4+++ b/django/core/management/commands/loaddata.py
5@@ -199,13 +199,6 @@ class Command(BaseCommand):
6                                 finally:
7                                     fixture.close()
8 
9-                                # If the fixture we loaded contains 0 objects, assume that an
10-                                # error was encountered during fixture loading.
11-                                if objects_in_fixture == 0:
12-                                    raise CommandError(
13-                                        "No fixture data found for '%s'. (File format may be invalid.)" %
14-                                            (fixture_name))
15-
16             # Since we disabled constraint checks, we must manually check for
17             # any invalid keys that might have been added
18             table_names = [model._meta.db_table for model in models]