'Ensure that \'unique\' constraints aren\'t overridden by
meta.indexes.'

def test_unique_and_indexes(self):

    class Customer(Document, ):
        cust_id = IntField(unique=True, required=True)
        meta = {'indexes': ['cust_id'], 'allow_inheritance': False}
    Customer.drop_collection()
    cust = Customer(cust_id=1)
    cust.save()
    cust_dupe = Customer(cust_id=1)
    try:
        cust_dupe.save()
        raise AssertionError('We    saved    a    dupe!')
    except NotUniqueError:
        pass
