Moved change to right place and added fancier test
This commit is contained in:
parent
4525eb457b
commit
4dc158589c
@ -4,6 +4,7 @@ Changelog
|
|||||||
|
|
||||||
Changes in 0.10.1 - DEV
|
Changes in 0.10.1 - DEV
|
||||||
=======================
|
=======================
|
||||||
|
- Fix infinite recursion with CASCADE delete rules under specific conditions. #1046
|
||||||
|
|
||||||
Changes in 0.10.0
|
Changes in 0.10.0
|
||||||
=================
|
=================
|
||||||
@ -34,7 +35,6 @@ Changes in 0.10.0
|
|||||||
- Allow dynamic lookup for more than two parts. #882
|
- Allow dynamic lookup for more than two parts. #882
|
||||||
- Added support for min_distance on geo queries. #831
|
- Added support for min_distance on geo queries. #831
|
||||||
- Allow to add custom metadata to fields #705
|
- Allow to add custom metadata to fields #705
|
||||||
- Fix infinite recursion with CASCADE delete rules under specific conditions. #1046
|
|
||||||
|
|
||||||
Changes in 0.9.0
|
Changes in 0.9.0
|
||||||
================
|
================
|
||||||
|
@ -1430,6 +1430,30 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
self.assertRaises(DoesNotExist, base.reload)
|
self.assertRaises(DoesNotExist, base.reload)
|
||||||
self.assertRaises(DoesNotExist, other.reload)
|
self.assertRaises(DoesNotExist, other.reload)
|
||||||
|
|
||||||
|
def test_reverse_delete_rule_cascade_complex_cycle(self):
|
||||||
|
"""Ensure reference cascading doesn't loop if reference graph isn't
|
||||||
|
a tree
|
||||||
|
"""
|
||||||
|
class Category(Document):
|
||||||
|
name = StringField()
|
||||||
|
|
||||||
|
class Dummy(Document):
|
||||||
|
reference = ReferenceField('self', reverse_delete_rule=CASCADE)
|
||||||
|
cat = ReferenceField(Category, reverse_delete_rule=CASCADE)
|
||||||
|
|
||||||
|
cat = Category(name='cat').save()
|
||||||
|
base = Dummy(cat=cat).save()
|
||||||
|
other = Dummy(reference=base).save()
|
||||||
|
other2 = Dummy(reference=other).save()
|
||||||
|
base.reference = other
|
||||||
|
base.save()
|
||||||
|
|
||||||
|
cat.delete()
|
||||||
|
|
||||||
|
self.assertRaises(DoesNotExist, base.reload)
|
||||||
|
self.assertRaises(DoesNotExist, other.reload)
|
||||||
|
self.assertRaises(DoesNotExist, other2.reload)
|
||||||
|
|
||||||
def test_reverse_delete_rule_cascade_self_referencing(self):
|
def test_reverse_delete_rule_cascade_self_referencing(self):
|
||||||
"""Ensure self-referencing CASCADE deletes do not result in infinite
|
"""Ensure self-referencing CASCADE deletes do not result in infinite
|
||||||
loop
|
loop
|
||||||
|
Loading…
x
Reference in New Issue
Block a user