コード例 #1
0
    def test_fixture(self):
        data = {'_id': '123', 'key': 'value'}
        db_name = 'db_test'
        coll_name = 'coll_test'
        conn = self.mongo_client[db_name][coll_name]
        fixture = Fixture(conn, data)
        fixture.insert()

        documents = list(conn.find())
        self.assertEqual(len(documents), 1)
        self.assertEqual(documents[0], data)
コード例 #2
0
    def test_fixture(self):
        data = {'_id': '123',
                'key': 'value'}
        db_name = 'db_test'
        coll_name = 'coll_test'
        conn = self.mongo_client[db_name][coll_name]
        fixture = Fixture(conn, data)
        fixture.insert()

        documents = list(conn.find())
        self.assertEqual(len(documents), 1)
        self.assertEqual(documents[0], data)
コード例 #3
0
def G(conn, *args, **kwargs):
    data = N(*args, **kwargs)
    fixture = Fixture(conn, data)
    fixture.insert()

    return data