def test_create_test_database_by_specific_good_name(self):
        from django.conf import settings
        try:
            assert settings.DATABASES in 'mongodb'
        except AttributeError:
            # Django <1.2
            return
        settings.DATABASES['mongodb']['TEST_NAME'] = "test_mustard"
        old_database_name = settings.DATABASES['mongodb']['NAME']
        from django.db import connections
        connection = connections['mongodb']

        connection.creation.create_test_db()
        test_database_name = settings.DATABASES['mongodb']['NAME']
        self.assertTrue('test_' in test_database_name)

        from mongokit import Connection
        con = Connection()
        # the test database isn't created till it's needed
        self.assertTrue(test_database_name not in con.database_names())

        # creates it
        db = con[settings.DATABASES['mongodb']['NAME']]
        coll = db.test_collection_name
        # do a query on the collection to force the database to be created
        list(coll.find())
        test_database_name = settings.DATABASES['mongodb']['NAME']
        self.assertTrue(test_database_name in con.database_names())

        connection.creation.destroy_test_db(old_database_name)
        self.assertTrue('test_mustard' not in
                        settings.DATABASES['mongodb']['NAME'])
        self.assertTrue(test_database_name not in con.database_names())

#
# DocumentForm tests follow
#
dataset/ETHPy150Open peterbe/django-mongokit/django_mongokit/tests.py/MongoDBBaseTestCase.test_create_test_database_by_specific_good_name/swapped operands of `in`