check both NotUniqueError and OperationError in tests

Seems mongoengine changed its exception type, when try to save a
duplicate key, it will raise OperationError, not NotUniqueError,
so check both of the two exceptions, or py.test will fail.