def tearDownClass(cls): Article.drop_collection() Feed.drop_collection()
from oneflow.base.tests import (connect_mongodb_testsuite, TEST_REDIS) #from unittest import skip DjangoUser = get_user_model() LOGGER = logging.getLogger(__file__) # Use the test database not to pollute the production/development one. RedisStatsCounter.REDIS = TEST_REDIS TEST_REDIS.flushdb() connect_mongodb_testsuite() # Empty the database before starting in case an old test failed to tearDown(). Article.drop_collection() Read.drop_collection() User.drop_collection() Feed.drop_collection() Tag.drop_collection() WebSite.drop_collection() Author.drop_collection() @override_settings(STATICFILES_STORAGE= 'pipeline.storage.NonPackagingPipelineStorage', CELERY_EAGER_PROPAGATES_EXCEPTIONS=True, CELERY_ALWAYS_EAGER=True, BROKER_BACKEND='memory',) class HomeAndPreferencesViewTest(TestCase):