Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/migrations/test_state.py
Commit message (Collapse)AuthorAgeFilesLines
* Refs #18012 -- Accounted for reverse proxy relations in ↵Simon Charette2015-10-201-0/+10
| | | | | | migrations. Thanks to Markus for the suggestion and Tim for the review.
* Fixed #23395 -- Limited line lengths to 119 characters.Dražen Odobašić2015-09-121-1/+4
|
* Refs #24215 -- Improved error message for unhandled lazy ↵Alex Hill2015-09-081-4/+34
| | | | model operations.
* Fixed #21127 -- Started deprecation toward requiring ↵Flavio Curella2015-07-281-25/+46
| | | | on_delete for ForeignKey/OneToOneField
* Fixed #25040 -- Fixed migrations state crash with ↵Kai Richard Koenig2015-07-021-0/+7
| | | | GenericForeignKey
* Refs #20203 -- Allowed adding custom default manager to ↵Andriy Sokolovskiy2015-06-301-0/+20
| | | | | | | | | the model state If the only manager on the model is the default manager defined by Django (`objects = models.Manager()`), this manager will not be added to the model state. If it is custom, it needs to be passed to the model state.
* Refs #24652 -- Used SimpleTestCase where appropriate.Simon Charette2015-05-201-3/+3
|
* Fixed #24812 -- Fixed app registry RuntimeWarnings in ↵Tim Graham2015-05-181-0/+9
| | | | schema and migrations tests.
* Moved migration exception classes to shared moduleMarkus Holtermann2015-05-021-1/+2
| | | | Thanks Aymeric Augustin for the review.
* Fixed #24701 -- Converted model manager names to unicode ↵Markus Holtermann2015-04-251-1/+6
| | | | | | | in migrations Thanks to Reto Aebersold for reporting the issue and Tim Graham and Claude Paroz for the review.
* Fixed #24573 -- Considered new related models for reloadingMarkus Holtermann2015-04-211-1/+52
| | | | Thanks tttomekkk for the report.
* Fixed #24591 -- Optimized cloning of ModelState objects.Marten Kenbeek2015-04-211-0/+16
| | | | | Changed ModelState.clone() to create a shallow copy of self.fields and self.managers.
* Refs #24397 -- Sped up model reloading in ProjectState.Marten Kenbeek2015-04-201-0/+16
| | | | | Created bulk_update() context manager on StateApps. Sped up unregistering models in reload_models() by using this context mananger.
* Fixed #24513 -- Made sure a model is only rendered once ↵Patryk Zawadzki2015-04-071-1/+52
| | | | | | | | | during reloads 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.
* Fixed #24483 -- Prevented keepdb from breaking with ↵David Szotten2015-03-241-0/+20
| | | | | | | | | generator choices. 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`.
* Fixed #24291 - Fixed migration ModelState generation ↵Marten Kenbeek2015-02-181-1/+53
| | | | | | | | | with unused swappable 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.
* Added tests for get_related_models_recursiveMarkus Holtermann2015-02-161-2/+223
|
* Refs #24225 -- Added failing test case for removing a ↵Claude Paroz2015-02-161-1/+50
| | | | | | | | | | | previously added field 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.
* Sorted imports with isort; refs #23860.Tim Graham2015-02-061-3/+6
|
* Fixed typos in code comments.Adam Taylor2015-01-201-1/+1
|
* Fixed #24147 -- Prevented managers leaking model during ↵Markus Holtermann2015-01-141-0/+38
| | | | | | migrations Thanks Tim Graham for the review.
* Fixed #12663 -- Formalized the Model._meta API for ↵Daniel Pyrathon2015-01-071-2/+2
| | | | | | | retrieving fields. Thanks to Russell Keith-Magee for mentoring this Google Summer of Code 2014 project and everyone else who helped with the patch!
* Fixed #23745 -- Reused states as much as possible in ↵Claude Paroz2015-01-021-27/+27
| | | | | | migrations Thanks Tim Graham and Markus Holtermann for the reviews.
* Replaced migration state render() by apps cached propertyClaude Paroz2015-01-021-12/+10
| | | | Refs #23745.
* Fixed #23822 -- Added support for serializing model ↵Markus Holtermann2014-12-151-10/+98
| | | | | | | managers in migration Thanks to Shai Berger, Loïc Bistuer, Simon Charette, Andrew Godwin, Tim Graham, Carl Meyer, and others for their review and input.
* Replaced set([foo, ...]) by {foo, ...} literals. Refs PR ↵Thomas Chaumeny2014-09-281-1/+1
| | | | | | 3282. Thanks Collin Anderson for the review.
* Fixed #23483 -- Prevented ImproperlyConfigured with ↵Szilveszter Farkas2014-09-121-0/+21
| | | | | | | | dotted app names Made sure the app labels stay unique for the AppConfigStubs, so migrations wouldn't fail if two dotted app names has the same last part (e.g. django.contrib.auth and vendor.auth)
* Fixed #22906 -- Added a more helpful repr to migrations' ↵Loic Bistuer2014-07-061-0/+10
| | | | | | ModelState. Thanks Collin Anderson for the report and original patch.
* Fixed #22470: Full migration support for ↵Andrew Godwin2014-06-151-0/+31
| | | | order_with_respect_to
* Fixed #22659 -- Prevent model states from sharing field ↵Simon Charette2014-06-011-1/+18
| | | | | | instances. Thanks to Trac alias tbartelmess for the report and the test project.
* flake8 fixes.Tim Graham2014-05-011-0/+1
|
* Cleanup failing test w/contenttypes and remove useless ↵Andrew Godwin2014-05-011-1/+4
| | | | graph load
* Fixed #22485: Include all unmigrated apps in project ↵Andrew Godwin2014-04-301-0/+25
| | | | state by default.
* Fixed #22447 -- Make sure custom model bases can be ↵Simon Charette2014-04-291-0/+8
| | | | | | migrated. Thanks to cdestigter for the report.
* Fixed flake8 errors.Tim Graham2014-04-201-0/+3
|
* Fixed #22397 -- Issues removing M2M field with explicit ↵Andrew Gorcester2014-04-181-0/+41
| | | | | | | | | | | | | | through model Changed the migration autodetector to remove models last so that FK and M2M fields will not be left as dangling references. Added a check in the migration state renderer to error out in the presence of dangling references instead of leaving them as strings. Fixed a bug in the sqlite backend to handle the deletion of M2M fields with "through" models properly (i.e., do nothing successfully). Thanks to melinath for report, loic for tests and andrewgodwin and charettes for assistance with architecture.
* Revert "Fixed #22397 -- Issues removing M2M field with ↵Simon Charette2014-04-181-30/+0
| | | | | | | | explicit through model." This reverts commit 00e3b9a2a992ee0b7288eeeb03e7cbd52ebc6dce. It's causing a regression when tested with the proxy_model_inheritance tests.
* Fixed #22397 -- Issues removing M2M field with explicit ↵Andrew Gorcester2014-04-171-0/+30
| | | | | | | | | | | | | | through model. Changed the migration autodetector to remove models last so that FK and M2M fields will not be left as dangling references. Added a check in the migration state renderer to error out in the presence of dangling references instead of leaving them as strings. Fixed a bug in the sqlite backend to handle the deletion of M2M fields with "through" models properly (i.e., do nothing successfully). Thanks to melinath for report, loic for tests and andrewgodwin and charettes for assistance with architecture.
* Fixed #22331 -- Made MigrationAutodetector ignore ↵Tim Graham2014-03-251-11/+0
| | | | | | | | unmanaged models. This commit reverts 69d4b1c and tackle the issue from a different angle. Models remain present in the project state, but are now ignored by the autodetector.
* Fixed #22331 -- Fixed migrations ProjectState to ignore ↵Loic Bistuer2014-03-251-0/+11
| | | | unmanaged models.
* Fixed #21893 -- ModelState didn't account for MTI ↵Loic Bistuer2014-03-041-0/+15
| | | | parents inherited from abstract models.
* Fixed #22172 -- Allowed index_together to be a single ↵Anubhav Joshi2014-03-011-1/+2
| | | | | | list (rather than list of lists).. Thanks EmilStenstrom for the suggestion.
* Fixed a small collection of flake8 violations that had ↵Alex Gaynor2014-01-201-0/+1
| | | | snuck in
* Remove other unicode literalAndrew Godwin2014-01-191-1/+1
|
* Fixed #21664: Multi-table inheritance was duplicating ↵Andrew Godwin2014-01-191-1/+30
| | | | _ptr fields
* Populated Apps instances immediately by default.Aymeric Augustin2013-12-301-3/+3
|
* Renamed AppCache to Apps.Aymeric Augustin2013-12-241-36/+36
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-221-1/+1
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Deborgified the app cache.Aymeric Augustin2013-12-171-10/+10
| | | | | | | | | | | | | Improved Andrew's hack to create temporary app caches to handle migrations. Now the main app cache has a "master" flag set to True (which is a non-default keyword argument, thus unlikely to be used by mistake). Other app cache instances have "master" set to False. The only sanctioned way to access the app cache is by importing django.core.apps.app_cache. If you were instanciating an app cache and relying on the Borg pattern, you'll have to refactor your code.
* Moved the new app cache inside core.Aymeric Augustin2013-12-171-1/+1
|