'Ensure you can limit GenericEmbeddedDocument choices.'

def test_generic_embedded_document_choices(self):

    class Car(EmbeddedDocument, ):
        name = StringField()
    class Dish(EmbeddedDocument, ):
        food = StringField(required=True)
        number = IntField()
    class Person(Document, ):
        name = StringField()
        like = GenericEmbeddedDocumentField(choices=(Dish,))
    Person.drop_collection()
    person = Person(name='Test    User')
    person.like = Car(name='Fiat')
    self.assertRaises(ValidationError, person.validate)
    person.like = Dish(food='arroz', number=15)
    person.save()
    person = Person.objects.first()
    self.assertTrue(isinstance(person.like, Dish))
