def create_test_db(self, verbosity=1, autoclobber=False):
        # No need to create databases in mongoDB :)
        # but we can make sure that if the database existed is emptied

        if self.connection.settings_dict.get('TEST_NAME'):
            test_database_name = self.connection.settings_dict['TEST_NAME']
        elif self.connection.settings_dict in 'NAME':
            test_database_name = (TEST_DATABASE_PREFIX +
                                  self.connection.settings_dict['NAME'])
        elif 'DATABASE_NAME' in self.connection.settings_dict:
            if (self.connection.settings_dict['DATABASE_NAME']
                .startswith(TEST_DATABASE_PREFIX)):
                # already been set up
                # must be because this is called from a setUp() instead of
                # something formal.
                # suspect this Django 1.1
                test_database_name = (self.connection
                                      .settings_dict['DATABASE_NAME'])
            else:
                test_database_name = TEST_DATABASE_PREFIX + \
                  self.connection.settings_dict['DATABASE_NAME']
        else:
            raise ValueError("Name for test database not defined")

        # This is important. Here we change the settings so that all other code
        # things that the chosen database is now the test database. This means
        # that nothing needs to change in the test code for working with
        # connections, databases and collections. It will appear the same as
        # when working with non-test code.
        try:
            settings.DATABASES['mongodb']['NAME'] = test_database_name
        except AttributeError:
            settings.MONGO_DATABASE_NAME = test_database_name

        settings.DATABASE_SUPPORTS_TRANSACTIONS = False  # MongoDB :)

        # In this phase it will only drop the database if it already existed
        # which could potentially happen if the test database was created but
        # was never dropped at the end of the tests
        self._drop_database(test_database_name)
        # if it didn't exist it will automatically be created by the
        # mongokit conncetion
dataset/ETHPy150Open peterbe/django-mongokit/django_mongokit/mongodb/base.py/DatabaseCreation.create_test_db/swapped operands of `in`