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