1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Migration VCS conflict detection and --merge for makemigrations

This commit is contained in:
Andrew Godwin
2013-12-04 16:01:31 +00:00
parent cd9e85ece9
commit 3b8e46cbc7
11 changed files with 341 additions and 117 deletions

View File

@@ -1,6 +1,7 @@
# encoding: utf8
from django.test import TestCase
from django.db.migrations.autodetector import MigrationAutodetector, MigrationQuestioner
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.questioner import MigrationQuestioner
from django.db.migrations.state import ProjectState, ModelState
from django.db.migrations.graph import MigrationGraph
from django.db import models
@@ -63,7 +64,7 @@ class AutodetectorTests(TestCase):
# Use project state to make a new migration change set
before = self.make_project_state([])
after = self.make_project_state([self.author_empty, self.other_pony, self.other_stable, self.third_thing])
autodetector = MigrationAutodetector(before, after, MigrationQuestioner({"ask_initial": True}))
autodetector = MigrationAutodetector(before, after, MigrationQuestioner(defaults={"ask_initial": True}))
changes = autodetector._detect_changes()
# Run through arrange_for_graph
graph = MigrationGraph()