fixed tests that were using undefined model fields
This commit is contained in:
parent
06064decd2
commit
67bf6afc89
@ -2717,9 +2717,11 @@ class FieldTest(unittest.TestCase):
|
|||||||
|
|
||||||
class Animal(Document):
|
class Animal(Document):
|
||||||
id = SequenceField(primary_key=True)
|
id = SequenceField(primary_key=True)
|
||||||
|
name = StringField()
|
||||||
|
|
||||||
class Person(Document):
|
class Person(Document):
|
||||||
id = SequenceField(primary_key=True)
|
id = SequenceField(primary_key=True)
|
||||||
|
name = StringField()
|
||||||
|
|
||||||
self.db['mongoengine.counters'].drop()
|
self.db['mongoengine.counters'].drop()
|
||||||
Animal.drop_collection()
|
Animal.drop_collection()
|
||||||
|
@ -1492,6 +1492,7 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
"""Ensure that atomic updates work properly.
|
"""Ensure that atomic updates work properly.
|
||||||
"""
|
"""
|
||||||
class BlogPost(Document):
|
class BlogPost(Document):
|
||||||
|
name = StringField()
|
||||||
title = StringField()
|
title = StringField()
|
||||||
hits = IntField()
|
hits = IntField()
|
||||||
tags = ListField(StringField())
|
tags = ListField(StringField())
|
||||||
@ -2878,12 +2879,14 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
self.assertEqual(authors, [mark_twain, john_tolkien])
|
self.assertEqual(authors, [mark_twain, john_tolkien])
|
||||||
|
|
||||||
def test_distinct_ListField_ReferenceField(self):
|
def test_distinct_ListField_ReferenceField(self):
|
||||||
class Foo(Document):
|
|
||||||
bar_lst = ListField(ReferenceField('Bar'))
|
|
||||||
|
|
||||||
class Bar(Document):
|
class Bar(Document):
|
||||||
text = StringField()
|
text = StringField()
|
||||||
|
|
||||||
|
class Foo(Document):
|
||||||
|
bar = ReferenceField('Bar')
|
||||||
|
bar_lst = ListField(ReferenceField('Bar'))
|
||||||
|
|
||||||
Bar.drop_collection()
|
Bar.drop_collection()
|
||||||
Foo.drop_collection()
|
Foo.drop_collection()
|
||||||
|
|
||||||
|
@ -947,6 +947,8 @@ class FieldTest(unittest.TestCase):
|
|||||||
|
|
||||||
class Asset(Document):
|
class Asset(Document):
|
||||||
name = StringField(max_length=250, required=True)
|
name = StringField(max_length=250, required=True)
|
||||||
|
path = StringField()
|
||||||
|
title = StringField()
|
||||||
parent = GenericReferenceField(default=None)
|
parent = GenericReferenceField(default=None)
|
||||||
parents = ListField(GenericReferenceField())
|
parents = ListField(GenericReferenceField())
|
||||||
children = ListField(GenericReferenceField())
|
children = ListField(GenericReferenceField())
|
||||||
|
@ -176,7 +176,7 @@ class QuerySetTest(unittest.TestCase):
|
|||||||
|
|
||||||
class Note(Document):
|
class Note(Document):
|
||||||
meta = dict(queryset_class=LimitCountQuerySet)
|
meta = dict(queryset_class=LimitCountQuerySet)
|
||||||
text = StringField()
|
name = StringField()
|
||||||
|
|
||||||
Note.drop_collection()
|
Note.drop_collection()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user