'Ensure that a document with an embedded document field may
be saved in the database.'

def test_updating_an_embedded_document(self):

    class EmployeeDetails(EmbeddedDocument, ):
        position = StringField()
    class Employee(self.Person, ):
        salary = IntField()
        details = EmbeddedDocumentField(EmployeeDetails)
    employee = Employee(name='Test    Employee', age=50, salary=20000)
    employee.details = EmployeeDetails(position='Developer')
    employee.save()
    promoted_employee = Employee.objects.get(name='Test    Employee')
    promoted_employee.details.position = 'Senior    Developer'
    promoted_employee.save()
    promoted_employee.reload()
    self.assertEqual(promoted_employee.name, 'Test    Employee')
    self.assertEqual(promoted_employee.age, 50)
    self.assertEqual(promoted_employee.details.position, 'Senior    Developer')
    promoted_employee.details = None
    promoted_employee.save()
    promoted_employee.reload()
    self.assertEqual(promoted_employee.details, None)
