'Make sure that calling to_mongo on a ReferenceField which
has dbref=False, but actually actually contains a DBRef returns
an ID of that DBRef.'

def test_dbref_to_mongo(self):

    class Person(Document, ):
        name = StringField()
        parent = ReferenceField('self', dbref=False)
    p = Person(name='Steve', parent=DBRef('person', 'abcdefghijklmnop'))
    self.assertEqual(p.to_mongo(), SON([('name', u'Steve'), ('parent', 'abcdefghijklmnop')]))
