title: How to check MongoDB connection usning unittest and Python
body: <p>I need to write a unit test in Python to check MongoDB connection, and at the end check if there is duplicated fields. 
  Does anyone know how to write a Python unittest for checking server or local host connection with MongoDB?</p>
  
  <p>Thanks in advance.</p>