summaryrefslogtreecommitdiff
path: root/tests/migrations/test_loader.py
AgeCommit message (Collapse)Author
2022-10-31Used more augmented assignment statements.Nick Pope
Identified using the following command: $ git grep -I '\(\<[_a-zA-Z0-9]\+\>\) *= *\1 *[-+/*^%&|<>@]'
2022-02-07Refs #33476 -- Refactored code to strictly match 88 characters line length.Mariusz Felisiak
2022-02-07Refs #33476 -- Reformatted code with Black.django-bot
2021-08-30Refs #24900 -- Added MigrationLoader test for applying squashed migrations.Jacob Walls
2021-08-04Fixed typos in migrations tests, comments, and error message.Jacob Walls
2021-08-04Used assertRaisesMessage() to test ↵Mariusz Felisiak
MigrationLoader.get_migration_by_prefix()'s error messages.
2020-12-31Fixed #31413 -- Fixed isolation of migrations.test_loader on databases that ↵Hasan Ramezani
don't support transactions.
2020-12-29Fixed #32302 -- Allowed migrations to be loaded from regular packages with ↵William Schwartz
no __file__ attribute. The migrations loader prevents the use of PEP-420 namespace packages for holding apps' migrations modules. Previously the loader tested for this only by checking that app.migrations.__file__ is present. This prevented migrations' being found in frozen Python environments that don't set __file__ on any modules. Now the loader *additionally* checks whether app.migrations.__path__ is a list because namespace packages use a different type for __path__. Namespace packages continue to be forbidden, and, in fact, users of normal Python environments should experience no change whatsoever.
2020-07-22Reverted "Fixed #30300 -- Allowed migrations to be loaded from directories ↵Tim Graham
without __init__.py file." This reverts commit 3cd3bebe8921e14b911b36b2a1cbceef8fb6294e.
2020-04-22Fixed #31499 -- Stored ModelState.fields into a dict.Simon Charette
This allows the removal of its O(n) .get_field_by_name method and many other awkward access patterns. While fields were initially stored in a list to preserve the initial model definiton field ordering the auto-detector doesn't take field ordering into account and no operations exists to reorder fields of a model. This makes the preservation of the field ordering completely superflous because field reorganization after the creation of the model state wouldn't be taken into account.
2019-10-10Fixed #30300 -- Allowed migrations to be loaded from directories without ↵Benjy Weinberger
__init__.py file.
2019-03-07Refs #30186 -- Changed MigrationRecorder.applied_migrations() to return a dict.Tim Schilling
2019-01-10Refs #28478 -- Deprecated TestCase's allow_database_queries and multi_db in ↵Simon Charette
favor of databases.
2018-09-11Fixed #29749 -- Made the migrations loader ignore files starting with a ↵Tim Graham
tilde or underscore. Regression in 29150d5da880ac1db15e47052330790cf1b802d2.
2018-06-15Fixed #29498 -- Fixed a missing pyc test file in source distribution.Tim Graham
2018-04-02Refs #23406 -- Fixed "invalid escape sequence" warning in migrations test.Jon Dufresne
2018-03-23Fixed #23406 -- Allowed migrations to be loaded from .pyc files.Dan Watson
2018-03-09Fixed #29180 -- Fixed a regression where migrations already in the plan were ↵Carlton Gibson
readded. Regression in a38ae914d89809aed6d79337b74a8b31b6d3849a.
2017-06-01Refs #23968 -- Removed unnecessary lists, generators, and tuple calls.Jon Dufresne
2017-02-10Added multi_db=True to test cases that access the 'other' db connection.Tim Graham
Fixed a failure in the context processors tests when running in reverse on MySQL due to an extra query after refs #27683.
2017-02-03Fixed spelling of "nonexistent".Tim Graham
2017-01-18Refs #23919 -- Removed six.PY2/PY3 usageClaude Paroz
Thanks Tim Graham for the review.
2017-01-18Refs #23919 -- Removed encoding preambles and future importsClaude Paroz
2016-09-17Refs #27025 -- Fixed "invalid escape sequence" warnings in Python 3.6.Tim Graham
http://bugs.python.org/issue27364
2016-09-16Fixed typo in tests/migrations/test_loader.py.Tim Graham
2016-09-01Fixed #27142, #27110 -- Made makemigrations consistency checks respect ↵Tim Graham
database routers. Partially reverted refs #27054 except for one of the tests as this solution supersedes that one. Thanks Shai Berger for the review.
2016-08-30Fixed #25109 -- Stopped silencing explicitly specified migration modules ↵Simon Charette
import errors. Thanks Tim for the review.
2016-08-23Fixed #27089 -- Added database alias to InconsistentMigrationHistory message.Tim Graham
2016-08-18Fixed #27054 -- Fixed makemigrations crash with a read-only database.Jim Nicholls
2016-08-05Fixed #27004 -- Made migrations consistency check ignore unapplied squashed ↵Jarek Glowacki
migrations.
2016-07-14Reverted "Fixed #25388 -- Added an option to allow disabling of migrations ↵Tim Graham
during test database creation" This reverts commit 157d7f1f1de4705daddebb77f21bd7097a74513d since it disables migrations all the time, not just during tests.
2016-05-08Sorted migration list order in test; added trailing comma.Jarek Glowacki
2016-05-08Fixed #25945, #26292 -- Refactored MigrationLoader.build_graph()Jarek Glowacki
2016-04-05Fixed #25850 -- Made migrate/makemigrations error on inconsistent history.Attila Tovt
2016-03-23Refs #25388 -- Used in-memory database in test_disable_migrations.Berker Peksag
2016-03-23Fixed #25388 -- Added an option to allow disabling of migrations during test ↵Berker Peksag
database creation
2016-02-24Used addCleanup() to call recorder.flush() in migration loader tests.Tim Graham
2015-09-12Fixed #24919 -- Allowed disabling of migrations on a per app basisMarkus Holtermann
2015-06-02Fixed #24895 -- Fixed loading a pair of squashed migrations with a dependency.Carl Meyer
2015-05-25Fixed #24848 -- Fixed ValueError for faulty migrations module.Marten Kenbeek
Added apps to unmigrated apps if the migrations module is a file or a folder missing __init__.py. Thanks to Ernest0x for the bug report.
2015-05-02Moved migration exception classes to shared moduleMarkus Holtermann
Thanks Aymeric Augustin for the review.
2015-02-06Sorted imports with isort; refs #23860.Tim Graham
2015-02-03Refactored tests that rely on an ImportError for Python 3.5 compatibilityTim Graham
A change in Python test discovery [1] causes the old packages that raised an error to be discovered; now we use a common directory that's ignored during discovery. Refs #23763. [1] http://bugs.python.org/issue7559
2014-10-30Fixed #23733 -- Fixed squashing migrations that depend on multiple apps.twidi
2014-10-30Fixed #23556 -- Raised a more meaningful error message when migrations refer ↵Markus Holtermann
to an unavailable node
2014-09-29Replaced set([foo, ...]) by {foo, ...} literals. Refs PR 3282.Thomas Chaumeny
Thanks Collin Anderson for the review.
2014-09-05Revert "Fixed #23384 -- Allowed overriding part of a dictionary-type setting"Claude Paroz
This reverts commit 66757fee7e921ad4c35e0b3f80c25e026100b31c. Discussions have led to think that this functionality does not bring significant benefits to justify the added complexity. Read also discussions on ticket #22734.
2014-08-30Fixed #23384 -- Allowed overriding part of a dictionary-type settingClaude Paroz
This change is needed for upcoming changes where settings might be grouped in a parent dictionary. Thanks Tim Graham for the review.
2014-07-22Fixed #23071 -- Use last migration's name in dependency to other appJeroen Dekkers
Changed the autodetector to lookup the name of the other app's last migration in the graph and use that as dependency instead of using __latest__.
2014-06-17Fixed #22861: Internal migrations done first so __first__ worksAndrew Godwin
Thanks to Chris Beaven.