@@ -1328,7 +1328,7 @@ class BlogPost(Document):
1328
1328
self .assertEqual (1 , BlogPost .objects .count ())
1329
1329
1330
1330
def test_reverse_delete_rule_cascade_on_abstract_document (self ):
1331
- """Ensure cascading deletion of referring documents from the database
1331
+ """Ensure cascading deletion of referring documents from the database
1332
1332
does not fail on abstract document.
1333
1333
"""
1334
1334
class AbstractBlogPost (Document ):
@@ -1350,7 +1350,7 @@ class BlogPost(AbstractBlogPost):
1350
1350
1351
1351
self .assertEqual (3 , BlogPost .objects .count ())
1352
1352
self .Person .objects (name = 'Test User' ).delete ()
1353
- self .assertEqual (1 , BlogPost .objects .count ())
1353
+ self .assertEqual (1 , BlogPost .objects .count ())
1354
1354
1355
1355
def test_reverse_delete_rule_cascade_self_referencing (self ):
1356
1356
"""Ensure self-referencing CASCADE deletes do not result in infinite
@@ -1411,8 +1411,8 @@ class BlogPost(Document):
1411
1411
self .assertEqual (1 , BlogPost .objects .count ())
1412
1412
self .assertEqual (None , BlogPost .objects .first ().category )
1413
1413
1414
- def test_reverse_delete_rule_nullify_on_abstract_document (self ):
1415
- """Ensure nullification of references to deleted documents when
1414
+ def test_reverse_delete_rule_nullify_on_abstract_document (self ):
1415
+ """Ensure nullification of references to deleted documents when
1416
1416
reference is on an abstract document.
1417
1417
"""
1418
1418
class AbstractBlogPost (Document ):
@@ -1474,7 +1474,7 @@ class BlogPost(AbstractBlogPost):
1474
1474
1475
1475
self .assertEqual (1 , BlogPost .objects .count ())
1476
1476
self .assertRaises (OperationError , self .Person .objects .delete )
1477
-
1477
+
1478
1478
def test_reverse_delete_rule_pull (self ):
1479
1479
"""Ensure pulling of references to deleted documents.
1480
1480
"""
@@ -1511,9 +1511,9 @@ def test_reverse_delete_rule_pull_on_abstract_documents(self):
1511
1511
"""
1512
1512
class AbstractBlogPost (Document ):
1513
1513
meta = {'abstract' : True }
1514
- authors = ListField (ReferenceField (self .Person ,
1514
+ authors = ListField (ReferenceField (self .Person ,
1515
1515
reverse_delete_rule = PULL ))
1516
-
1516
+
1517
1517
class BlogPost (AbstractBlogPost ):
1518
1518
content = StringField ()
1519
1519
@@ -1538,7 +1538,7 @@ class BlogPost(AbstractBlogPost):
1538
1538
1539
1539
self .assertEqual (post .authors , [me ])
1540
1540
self .assertEqual (another .authors , [])
1541
-
1541
+
1542
1542
def test_delete_with_limits (self ):
1543
1543
1544
1544
class Log (Document ):
@@ -3009,7 +3009,7 @@ class Book(Document):
3009
3009
def test_distinct_ListField_EmbeddedDocumentField_EmbeddedDocumentField (self ):
3010
3010
class Continent (EmbeddedDocument ):
3011
3011
continent_name = StringField ()
3012
-
3012
+
3013
3013
class Country (EmbeddedDocument ):
3014
3014
country_name = StringField ()
3015
3015
continent = EmbeddedDocumentField (Continent )
@@ -3026,7 +3026,7 @@ class Book(Document):
3026
3026
3027
3027
europe = Continent (continent_name = 'europe' )
3028
3028
asia = Continent (continent_name = 'asia' )
3029
-
3029
+
3030
3030
scotland = Country (country_name = "Scotland" , continent = europe )
3031
3031
tibet = Country (country_name = "Tibet" , continent = asia )
3032
3032
@@ -3041,9 +3041,9 @@ class Book(Document):
3041
3041
country_list = Book .objects .distinct ("authors.country" )
3042
3042
3043
3043
self .assertEqual (country_list , [scotland , tibet ])
3044
-
3044
+
3045
3045
continent_list = Book .objects .distinct ("authors.country.continent" )
3046
-
3046
+
3047
3047
self .assertEqual (continent_list , [europe , asia ])
3048
3048
3049
3049
def test_distinct_ListField_ReferenceField (self ):
0 commit comments