diff --git a/tests/fixtures_regress/fixtures/fixture.with.several.periods.in.name.json b/tests/fixtures_regress/fixtures/fixture.with.several.periods.in.name.json
new file mode 100644
index 0000000..1693177
-
|
+
|
|
| 1 | [ |
| 2 | { |
| 3 | "pk": "1", |
| 4 | "model": "fixtures_regress.thingy", |
| 5 | "fields": { |
| 6 | "name": "Whatchamacallit" |
| 7 | } |
| 8 | } |
| 9 | ] |
diff --git a/tests/fixtures_regress/fixtures/fixture_with.period_in_name.json b/tests/fixtures_regress/fixtures/fixture_with.period_in_name.json
new file mode 100644
index 0000000..1693177
-
|
+
|
|
| 1 | [ |
| 2 | { |
| 3 | "pk": "1", |
| 4 | "model": "fixtures_regress.thingy", |
| 5 | "fields": { |
| 6 | "name": "Whatchamacallit" |
| 7 | } |
| 8 | } |
| 9 | ] |
diff --git a/tests/fixtures_regress/tests.py b/tests/fixtures_regress/tests.py
index 4bfb45e..48f22dc 100644
a
|
b
|
class TestFixtures(TestCase):
|
469 | 469 | verbosity=0, |
470 | 470 | ) |
471 | 471 | |
| 472 | def test_fixture_name_with_period(self): |
| 473 | """ |
| 474 | Fixtures can contain a period in their filename (#21457). |
| 475 | """ |
| 476 | management.call_command( |
| 477 | 'loaddata', |
| 478 | 'fixture_with.period_in_name.json', |
| 479 | verbosity=0, |
| 480 | ) |
| 481 | queryset = Thingy.objects.all() |
| 482 | self.assertQuerysetEqual(queryset, ['Whatchamacallit'], lambda m: m.name) |
| 483 | |
| 484 | def test_fixture_name_with_several_periods(self): |
| 485 | """ |
| 486 | Fixtures can contain several periods in their filename (#21457). |
| 487 | """ |
| 488 | management.call_command( |
| 489 | 'loaddata', |
| 490 | 'fixture.with.several.periods.in.name.json', |
| 491 | verbosity=0, |
| 492 | ) |
| 493 | queryset = Thingy.objects.all() |
| 494 | self.assertQuerysetEqual(queryset, ['Whatchamacallit'], lambda m: m.name) |
| 495 | |
472 | 496 | |
473 | 497 | class NaturalKeyFixtureTests(TestCase): |
474 | 498 | |