Arthur de Jong

Open Source / Free Software developer

summaryrefslogtreecommitdiffstats
path: root/tests/migrations
Commit message (Collapse)AuthorAgeFilesLines
...
* | Added tests for MTI in RunPython.Loic Bistuer2014-03-041-3/+50
| |
* | 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 #22168 -- Fixed migrations failing on sqlite when ↵Baptiste Mispelon2014-03-011-0/+17
| | | | | | | | | | | | column names are SQL keywords Thanks to trac user fallen_flint for the report and initial patch.
* | Two whitespace changes to appease flake8Alex Gaynor2014-02-231-1/+1
| |
* | Fixed #22095 -- Enabled backward migrations for ↵Andrew Gorcester2014-02-231-4/+20
|/ | | | | | | | | RunPython operations Added reversible property to RunPython so that migrations will not refuse to reverse migrations including RunPython operations, so long as reverse_code is set in the RunPython constructor. Included tests to check the reversible property on RunPython and the similar RunSQL.
* Merge pull request #2270 from bmispelon/ticket-22030Andrew Godwin2014-02-171-0/+20
|\ | | | | Fixed #22030 -- Don't assume that all fields have a swappable_setting at...
| * Fixed #22030 -- Don't assume that all fields have a ↵Baptiste Mispelon2014-02-131-0/+20
| | | | | | | | swappable_setting attribute.
* | Fixed #22035 -- reordered migration operationsAnton Baklanov2014-02-151-0/+19
|/ | | | | | | Now AddField actions appear in operations list before AlterUniqueTogether actions. Thanks to SmileyChris for the report.
* Removed test for migration check forgotten in ↵Baptiste Mispelon2014-02-131-43/+0
| | | | 7e941ba67ceab8a74ba50509d13ed4298f8305cd.
* Fix my slightly hasty autodetector changesAndrew Godwin2014-02-121-2/+2
|
* Fixed #21954: Raise nice error when serializing ↵Andrew Godwin2014-02-091-0/+3
| | | | datetimes with timezones
* Removed unused imports + other flake8 fixes.Tim Graham2014-02-092-1/+2
|
* Fixed #21892: RunPython no longer accepts stringsAndrew Godwin2014-02-091-16/+7
|
* Adding tests for check_migrations.mlavin2014-02-081-0/+43
|
* Fix regress added to ↵Michael Manfre2014-02-021-1/+2
| | | | migrations.test_operations.test_alter_field_pk_fk
* Ensure cursors are closed when no longer needed.Michael Manfre2014-02-022-50/+57
| | | | | | This commit touchs various parts of the code base and test framework. Any found usage of opening a cursor for the sake of initializing a connection has been replaced with 'ensure_connection()'.
* Added some missing whitespace around arithmetic operatorsAlex Gaynor2014-01-221-1/+1
|
* Fixed #21852 -- Make migration writer serialize iteratorsMarkus Holtermann2014-01-221-0/+7
|
* Fixed a small collection of flake8 violations that had ↵Alex Gaynor2014-01-202-1/+2
| | | | snuck in
* Fixed #16905 -- Added extensible checks (nee validation) ↵Russell Keith-Magee2014-01-201-1/+16
| | | | | | | | | | | framework This is the result of Christopher Medrela's 2013 Summer of Code project. Thanks also to Preston Holmes, Tim Graham, Anssi Kääriäinen, Florian Apolloner, and Alex Gaynor for review notes along the way. Also: Fixes #8579, fixes #3055, fixes #19844.
* Remove other unicode literalAndrew Godwin2014-01-191-1/+1
|
* Remove unicode prefix that snuck inAndrew Godwin2014-01-191-1/+1
|
* Fixed #21664: Multi-table inheritance was duplicating ↵Andrew Godwin2014-01-192-1/+62
| | | | _ptr fields
* Fixed #21783: (again) Found second source of bug, also ↵Andrew Godwin2014-01-191-0/+8
| | | | squashed it.
* Fixed #21323 -- Improved readability of serialized ↵Loic Bistuer2014-01-191-1/+14
| | | | Operation.
* Implement swappable model support for migrationsAndrew Godwin2014-01-192-4/+28
|
* Make test stronger to hopefully fix odd Jenkins failureAndrew Godwin2014-01-081-1/+1
|
* Fixed #21142: Dependency failures on unmigrated apps.Andrew Godwin2014-01-084-2/+51
|
* Populated Apps instances immediately by default.Aymeric Augustin2013-12-301-3/+3
|
* Used Apps.clear_cache() in tests that alter the app ↵Aymeric Augustin2013-12-291-1/+1
| | | | registry.
* Renamed AppCache to Apps.Aymeric Augustin2013-12-245-49/+49
| | | | | | Also renamed app_cache to apps and "app cache" to "app registry". Deprecated AppCache.app_cache_ready() in favor of Apps.ready().
* Replaced ad-hoc caching of get_models with lru_cache.Aymeric Augustin2013-12-241-1/+1
| | | | | Invalidate properly the cache whenever all_models or app_configs change. This fixes some isolation issues in the test suite.
* Imported override_settings from its new location.Aymeric Augustin2013-12-233-4/+4
|
* Dropped AppCache._empty, _with_app and _without_app.Aymeric Augustin2013-12-231-2/+1
| | | | | It's now easier to achieve the same effect with modify_settings or override_settings.
* Moved apps back in the toplevel django namespace.Aymeric Augustin2013-12-224-4/+4
| | | | Reverted 4a56a93cc458e9ab4dcab95d9f5067d4975dd1a2.
* Expurged INSTALLED_APPS from code and tests.Aymeric Augustin2013-12-221-8/+7
| | | | Except the app cache code and a few specific tests, of course.
* Deprecated load_app().Aymeric Augustin2013-12-221-5/+5
| | | | | | | | | Adjusted several tests that used it to add apps to the app cache and then attempted to remove them by manipulating attributes directly. Also renamed invalid_models to invalid_models_tests to avoid clashing application labels between the outer and the inner invalid_models applications.
* Refactored registration of models.Aymeric Augustin2013-12-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Got rid of AppConfig._stub. As a side effect, app_cache.app_configs now only contains entries for applications that are in INSTALLED_APPS, which is a good thing and will allow dramatic simplifications (which I will perform in the next commit). That required adjusting all methods that iterate on app_configs without checking the "installed" flag, hence the large changes in get_model[s]. Introduced AppCache.all_models to store models: - while the app cache is being populated and a suitable app config object to register models isn't available yet; - for applications that aren't in INSTALLED_APPS since they don't have an app config any longer. Replaced get_model(seed_cache=False) by registered_model() which can be kept simple and safe to call at any time, and removed the seed_cache argument to get_model[s]. There's no replacement for that private API. Allowed non-master app caches to go through populate() as it is now safe to do so. They were introduced in 1.7 so backwards compatibility isn't a concern as long as the migrations framework keeps working.
* Deborgified the app cache.Aymeric Augustin2013-12-172-13/+13
| | | | | | | | | | | | | 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.
* Removed superfluous models.py files.Aymeric Augustin2013-12-171-0/+0
| | | | | | | Added comments in the three empty models.py files that are still needed. Adjusted the test runner to add applications corresponding to test labels to INSTALLED_APPS even when they don't have a models module.
* Moved the new app cache inside core.Aymeric Augustin2013-12-174-4/+4
|
* Simplified register_models.Aymeric Augustin2013-12-171-2/+2
| | | | | Since it's never called with more than one model at a time the current signature is needlessly complicated.
* Moved list of models inside AppConfig instances.Aymeric Augustin2013-12-172-4/+2
| | | | | | | | | | | | | | | | | | | | | | | This commit is a refactoring with no change of functionality, according to the following invariants: - An app_label that was in app_configs and app_models stays in app_config and has its 'installed' attribute set to True. - An app_label that was in app_models but not in app_configs is added to app_configs and has its 'installed' attribute set to True. As a consequence, all the code that iterated on app_configs is modified to check for the 'installed' attribute. Code that iterated on app_models is rewritten in terms of app_configs. Many tests that stored and restored the state of the app cache were updated. In the long term, we should reconsider the usefulness of allowing importing models from non-installed applications. This doesn't sound particularly useful, can be a trap in some circumstances, and causes significant complexity in sensitive areas of Django.
* Removed module-level functions for the app cache.Aymeric Augustin2013-12-173-10/+11
| | | | | | | | | | | | | | | Since the original ones in django.db.models.loading were kept only for backwards compatibility, there's no need to recreate them. However, many internals of Django still relied on them. They were also imported in django.db.models. They never appear in the documentation, except a quick mention of get_models and get_app in the 1.2 release notes to document an edge case in GIS. I don't think that makes them a public API. This commit doesn't change the overall amount of global state but clarifies that it's tied to the app_cache object instead of hiding it behind half a dozen functions.
* Removed BaseAppCache.app_store.Aymeric Augustin2013-12-172-15/+7
| | | | | It was only storing redundant information. This is part of the effort to allow applications without a models module.
* Moved django.db.models.loading to django.apps.cache.Aymeric Augustin2013-12-174-5/+5
| | | | This commit doesn't contain any code changes; it's purely a refactoring.
* Fix altering of SERIAL columns and InnoDB being picky ↵Andrew Godwin2013-12-111-1/+56
| | | | about FK changes
* Fixed ModelState breaking when unique_together has ↵Baptiste Mispelon2013-12-061-1/+1
| | | | unhashable elements.
* Fixed TypeError when rendering ModelState with multiple ↵Baptiste Mispelon2013-12-061-11/+37
| | | | bases.
* Fixed a flake8 errorAlex Gaynor2013-12-051-1/+1
|