title: How to test DoesNotExist exception of MongoEngine
body: <p>I'm using MongoEngine with Flask to develop a REST Api</p>
  
  <p>How can I test the exception of a DoesNotExist?</p>
  
  <p>If I use</p>
  
  <pre><code>assertRaises(DoesNotExist, Model.objects.get(id=id))
  </code></pre>
  
  <p>python interpreter raises a NameError exception.</p>
  
  <p>How can I import this DoesNotExist exception?</p>
  
  <p>I've seen some people importing</p>
  
  <pre><code>from django.db.models.base import ObjectDoesNotExist
  </code></pre>
  
  <p>but I am using Flask with MongoEngine and need to know from where should I import DoesNotExist</p>