additional fixes to support Mongo3.4
This commit is contained in:
@@ -603,18 +603,24 @@ class IndexesTest(unittest.TestCase):
|
||||
|
||||
@requires_mongodb_gte_34
|
||||
def test_primary_key_unique_not_working_under_mongo_34(self):
|
||||
"""Relates to #1445"""
|
||||
class Blog(Document):
|
||||
id = StringField(primary_key=True, unique=True)
|
||||
|
||||
Blog.drop_collection()
|
||||
|
||||
with self.assertRaises(OperationFailure) as ctx_err:
|
||||
Blog(id='garbage').save()
|
||||
self.assertIn("The field 'unique' is not valid for an _id index specification", str(ctx_err.exception))
|
||||
|
||||
@requires_mongodb_lte_32
|
||||
def test_primary_key_unique_working_under_mongo_32(self):
|
||||
"""Relates to #1445"""
|
||||
class Blog(Document):
|
||||
id = StringField(primary_key=True, unique=True)
|
||||
|
||||
Blog.drop_collection()
|
||||
|
||||
Blog(id='garbage').save()
|
||||
|
||||
def test_unique_with(self):
|
||||
|
||||
Reference in New Issue
Block a user