summaryrefslogtreecommitdiff
path: root/tests/custom_migration_operations
diff options
context:
space:
mode:
authorPatryk Zawadzki <patrys@room-303.com>2014-11-15 20:25:43 +0100
committerTim Graham <timograham@gmail.com>2014-11-20 12:49:49 -0500
commit21e21c7bc2b8bf7ae127e2aa75048a60d05a6e0f (patch)
tree4dcef326223e6f517610298794422f73da30478c /tests/custom_migration_operations
parent53908c1f934b32e83e9fa34c14910b1837f7f610 (diff)
downloaddjango-21e21c7bc2b8bf7ae127e2aa75048a60d05a6e0f.tar.gz
Fixed #23844 -- Used topological sort for migration operation dependency resolution.
This removes the concept of equality between operations to guarantee compatilibity with Python 3. Python 3 requires equality to result in identical object hashes. It's impossible to implement a unique hash that preserves equality as operations such as field creation depend on being able to accept arbitrary dicts that cannot be hashed reliably. Thanks Klaas van Schelven for the original patch in 13d613f80011852404198dfafd1f09c0c0ea42e6.
Diffstat (limited to 'tests/custom_migration_operations')
-rw-r--r--tests/custom_migration_operations/more_operations.py7
-rw-r--r--tests/custom_migration_operations/operations.py7
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/custom_migration_operations/more_operations.py b/tests/custom_migration_operations/more_operations.py
index 6fe3d1cf93..30cf246ceb 100644
--- a/tests/custom_migration_operations/more_operations.py
+++ b/tests/custom_migration_operations/more_operations.py
@@ -5,6 +5,13 @@ class TestOperation(Operation):
def __init__(self):
pass
+ def deconstruct(self):
+ return (
+ self.__class__.__name__,
+ [],
+ {}
+ )
+
@property
def reversible(self):
return True
diff --git a/tests/custom_migration_operations/operations.py b/tests/custom_migration_operations/operations.py
index fc084f8412..3a4127d753 100644
--- a/tests/custom_migration_operations/operations.py
+++ b/tests/custom_migration_operations/operations.py
@@ -5,6 +5,13 @@ class TestOperation(Operation):
def __init__(self):
pass
+ def deconstruct(self):
+ return (
+ self.__class__.__name__,
+ [],
+ {}
+ )
+
@property
def reversible(self):
return True