'Ensure that document may inherit fields from a superclass document.'

def test_inheritance_to_mongo_keys(self):

    class Person(Document, ):
        name = StringField()
        age = IntField()
        meta = {'allow_inheritance': True}
    class Employee(Person, ):
        salary = IntField()
    self.assertEqual(['_cls', 'age', 'id', 'name', 'salary'], sorted(Employee._fields.keys()))
    self.assertEqual(Person(name='Bob', age=35).to_mongo().keys(), ['_cls', 'name', 'age'])
    self.assertEqual(Employee(name='Bob', age=35, salary=0).to_mongo().keys(), ['_cls', 'name', 'age', 'salary'])
    self.assertEqual(Employee._get_collection_name(), Person._get_collection_name())
