improve tests health (flake8 warnings)

This commit is contained in:
Bastien Gérard
2019-09-01 15:03:29 +03:00
parent c61c6a8525
commit bc0c55e49a
34 changed files with 97 additions and 111 deletions

View File

@@ -1,10 +1,9 @@
# -*- coding: utf-8 -*-
from bson import DBRef, SON
import pytest
from mongoengine import *
from tests.utils import MongoDBTestCase
import pytest
class TestReferenceField(MongoDBTestCase):
@@ -59,21 +58,6 @@ class TestReferenceField(MongoDBTestCase):
with pytest.raises(ValidationError):
post1.validate()
def test_objectid_reference_fields(self):
"""Make sure storing Object ID references works."""
class Person(Document):
name = StringField()
parent = ReferenceField("self")
Person.drop_collection()
p1 = Person(name="John").save()
Person(name="Ross", parent=p1.pk).save()
p = Person.objects.get(name="Ross")
assert p.parent == p1
def test_dbref_reference_fields(self):
"""Make sure storing references as bson.dbref.DBRef works."""