summaryrefslogtreecommitdiff
path: root/tests/migrations
AgeCommit message (Collapse)Author
2015-06-01Fixed #24883 -- Added MigrationGraph.__repr__()Yoong Kang Lim
2015-05-26Fixed #24340 -- Added nested deconstruction for list, tuple and dict valuesMatt Westcott
Nested deconstruction should recursively deconstruct items within list, tuple and dict values.
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-20Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette
2015-05-18Fixed #24812 -- Fixed app registry RuntimeWarnings in schema and migrations ↵Tim Graham
tests.
2015-05-02Moved migration exception classes to shared moduleMarkus Holtermann
Thanks Aymeric Augustin for the review.
2015-04-30Fixed #24725 -- Allowed renaming of target models in ManyToMany relationsMarkus Holtermann
This is a regression caused by introducing rendered migration states in 1aa3e09c2043 and the _meta refactoring in fb48eb05816b. Thanks to Danilo Bargen for reporting the issue and Marten Kenbeek and Tim Graham for triaging the bug and providing the initial test case.
2015-04-25Fixed #24701 -- Converted model manager names to unicode in migrationsMarkus Holtermann
Thanks to Reto Aebersold for reporting the issue and Tim Graham and Claude Paroz for the review.
2015-04-21Fixed #24573 -- Considered new related models for reloadingMarkus Holtermann
Thanks tttomekkk for the report.
2015-04-20Fixed #24591 -- Optimized cloning of ModelState objects.Marten Kenbeek
Changed ModelState.clone() to create a shallow copy of self.fields and self.managers.
2015-04-20Refs #24397 -- Sped up model reloading in ProjectState.Marten Kenbeek
Created bulk_update() context manager on StateApps. Sped up unregistering models in reload_models() by using this context mananger.
2015-04-17Fixed #24595 -- Prevented loss of null info in MySQL field alterationClaude Paroz
Thanks Simon Percivall for the report, and Simon Charette and Tim Graham for the reviews.
2015-04-10Fixed #24514 -- Made migration writer omit models import if it's unused.Christopher Luc
2015-04-09Use mock.patch in migrations testsCurtis Maloney
Currently some of the migrations tests rely on the fact 'input' is aliased because of six, instead of using mock.patch. Replace this code with proper use of mock.patch. Also, replace one case of excessively specific python version check with testing six.PY3
2015-04-07Fixed #24513 -- Made sure a model is only rendered once during reloadsPatryk Zawadzki
This also prevents state modifications from corrupting previous states. Previously, when a model defining a relation was unregistered first, clearing the cache would cause its related models' _meta to be cleared and would result in the old models losing track of their relations.
2015-04-05Fixed #24278 -- Fixed serialization of migration operations.Marten Kenbeek
Fixed MigrationWriter.serialize() to correctly handle migration operations by utilizing OperationWriter. Thanks Piotr Maliński for the report.
2015-04-05Refs #24278 -- Allowed multi-line serializations in OperationWriter.Marten Kenbeek
Changed OperationWriter to support multi-line serialized values with correct indentation.
2015-04-02Fixed #24566 -- Added support for serializing timedeltaBaptiste Mispelon
Thanks to knbk for the report.
2015-03-30Fixed #24550 -- Added migration operation description to sqlmigrate outputMarkus Holtermann
Thanks Tim Graham for the review.
2015-03-29Refs #24366 -- Fixed recursion depth error in migration graphMarten Kenbeek
Made MigrationGraph forwards_plan() and backwards_plan() fall back to an iterative approach in case the recursive approach exceeds the recursion depth limit.
2015-03-29Refs #24366 -- Renamed arguments in MigrationGraph, renamed testsMarten Kenbeek
2015-03-28Fixed #24537 -- Ignored field order in RenameModel detectionMarkus Holtermann
Thanks to David Sanders for the report and test and Simon Charette for the review.
2015-03-25Renamed Field.rel attribute to remote_fieldAnssi Kääriäinen
Field.rel is now deprecated. Rel objects have now also remote_field attribute. This means that self == self.remote_field.remote_field. In addition, made the Rel objects a bit more like Field objects. Still, marked ManyToManyFields as null=True.
2015-03-24Fixed #24483 -- Prevented keepdb from breaking with generator choices.David Szotten
If Field.choices is provided as an iterator, consume it in __init__ instead of using itertools.tee (which ends up holding everything in memory anyway). Fixes a bug where deconstruct() was consuming the iterator but bypassing the call to `tee`.
2015-03-23Fixed #24521 -- Added support for serializing frozensets in migrations.Baptiste Mispelon
2015-03-16Fixed #24427 -- Stopped writing migration files in dry run mode when merging.John Giannelos
Also added display of migration to stdout when verbosity=3.
2015-03-14Refs #24354 -- Prevented repointing of relations on superclasses when ↵Matthew Wilkes
migrating a subclass's name change Forwardport of test and release note from stable/1.7.x
2015-03-08Fixed #23407 -- Extended coverage of makemigrations --noinput option.Marten Kenbeek
Changed --noinput option in makemigrations to suppress all user prompts, not just when combined with --merge.
2015-03-04Fixed #24435 -- Prevented m2m field removal and addition in migrations when ↵Markus Holtermann
changing blank Thanks Mark Tranchant for the report an Tim Graham for the test and review.
2015-02-23Made migrations tests write to a temporary directory.Aymeric Augustin
This is preferrable to writing in the current working directory because it eliminates the risk to leak unwanted files, which can result in very weird test failures. Also this will help if we ever try to run these tests concurrently.
2015-02-23Fixed #24366 -- Optimized traversal of large migration dependency graphs.Marten Kenbeek
Switched from an adjancency list and uncached, iterative depth-first search to a Node-based design with direct parent/child links and a cached, recursive depth-first search. With this change, calculating a migration plan for a large graph takes several seconds instead of several hours. Marked test `migrations.test_graph.GraphTests.test_dfs` as an expected failure due to reaching the maximum recursion depth.
2015-02-20Fixed #24351, #24346 -- Changed the signature of allow_migrate().Loic Bistuer
The new signature enables better support for routing RunPython and RunSQL operations, especially w.r.t. reusable and third-party apps. This commit also takes advantage of the deprecation cycle for the old signature to remove the backward incompatibility introduced in #22583; RunPython and RunSQL won't call allow_migrate() when when the router has the old signature. Thanks Aymeric Augustin and Tim Graham for helping shape up the patch. Refs 22583.
2015-02-18Fixed #24362: Made test run each migration operation in its own schema editorShai Berger
Thanks Tim Graham for pointing out the fix.
2015-02-18Fixed #24291 - Fixed migration ModelState generation with unused swappable ↵Marten Kenbeek
models Swapped out models don't have a _default_manager unless they have explicitly defined managers. ModelState.from_model() now accounts for this case and uses an empty list for managers if no explicit managers are defined and a model is swapped out.
2015-02-17Refs #24324 -- Fixed Python 2 test failures when path to Django source ↵Tim Graham
contains non-ASCII characters.
2015-02-16Added tests for get_related_models_recursiveMarkus Holtermann
2015-02-16Refs #24282 -- Added failing test case for assigning models of wrong type to FKMarkus Holtermann
Thanks Jeff Singer for the test case.
2015-02-16Refs #24264 -- Added failing test case for updating a FK when changing a PKMarkus Holtermann
When the primary key column is altered, foreign keys of referencing models must be aware of a possible data type change as well and thus need to be re-rendered. Thanks Tim Graham for the report.
2015-02-16Refs #24225 -- Added failing test case for removing a previously added field ↵Claude Paroz
in migrations When a related field is deleted, the related model must be updated. As unchanged models are shared in migration states, the related model must be re-rendered so that the change applies to a new copy of the related model. Thanks Henrik Heimbuerger for the report.
2015-02-13Fixed #24184 -- Prevented automatic soft-apply of migrationsMarkus Holtermann
Previously Django only checked for the table name in CreateModel operations in initial migrations and faked the migration automatically. This led to various errors and unexpected behavior. The newly introduced --fake-initial flag to the migrate command must be passed to get the same behavior again. With this change Django will bail out in with a "duplicate relation / table" error instead. Thanks Carl Meyer and Tim Graham for the documentation update, report and review.
2015-02-06Fixed E265 comment styleCollin Anderson
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
2015-01-20Fixed typos in code comments.Adam Taylor
2015-01-20Fixed #24155 -- Maintained kwargs and import order in migration writerMarkus Holtermann
Thanks Tomas Dobrovolny for the report and Tim Graham for the review.
2015-01-19Removed IPAddressField per deprecation timeline; refs #20439.Tim Graham
2015-01-17Cleaned up migration writer testsMarkus Holtermann
2015-01-15Fixed #24135 -- Made RenameModel rename many-to-many tables.Tim Graham
Thanks Simon and Markus for reviews.
2015-01-15Fixed #23850 -- Fixed a migrations test failure on Mac OS X & Python 3Collin Anderson
2015-01-14Fixed #24147 -- Prevented managers leaking model during migrationsMarkus Holtermann
Thanks Tim Graham for the review.