Commit 3c122e26 authored by Chris Mayo's avatar Chris Mayo

Make pymongo backend testing PyMongo 3 compatible

Fix deprecation warning that only requires PyMongo 3.0.0 in test_model.
parent 8a7bc2fc
import pymongo from pymongo import MongoClient
from flask import Flask from flask import Flask
from flask_admin import Admin from flask_admin import Admin
...@@ -9,8 +9,8 @@ def setup(): ...@@ -9,8 +9,8 @@ def setup():
app.config['SECRET_KEY'] = '1' app.config['SECRET_KEY'] = '1'
app.config['CSRF_ENABLED'] = False app.config['CSRF_ENABLED'] = False
conn = pymongo.Connection() client = MongoClient()
db = conn.tests db = client.tests
admin = Admin(app) admin = Admin(app)
......
...@@ -26,7 +26,7 @@ def test_model(): ...@@ -26,7 +26,7 @@ def test_model():
admin.add_view(view) admin.add_view(view)
# Drop existing data (if any) # Drop existing data (if any)
db.test.remove() db.test.delete_many({})
eq_(view.name, 'Test') eq_(view.name, 'Test')
eq_(view.endpoint, 'testview') eq_(view.endpoint, 'testview')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment