예제 #1
0
    def setUp(self):

        WebSite.drop_collection()
        Article.drop_collection()

        self.ws1 = WebSite(url='http://test1.com').save()
        self.ws2 = WebSite(url='http://test2.com').save()
예제 #2
0
    def setUp(self):

        WebSite.drop_collection()
        Article.drop_collection()

        self.ws1 = WebSite(url='http://test1.com').save()
        self.ws2 = WebSite(url='http://test2.com').save()
예제 #3
0
파일: test_stats.py 프로젝트: 1flow/1flow
 def tearDown(self):
     Article.drop_collection()
예제 #4
0
파일: test_stats.py 프로젝트: 1flow/1flow
import logging

from django.test import TestCase
from django.test.utils import override_settings

from oneflow.base.tests import connect_mongodb_testsuite
from oneflow.core.models import Article
from oneflow.core.stats import (PythonErrorClassifier, GenericErrorClassifier,
                                UrlErrorClassifier, ContentErrorClassifier)

LOGGER = logging.getLogger(__file__)

connect_mongodb_testsuite()

Article.drop_collection()


@override_settings(STATICFILES_STORAGE=
                   'pipeline.storage.NonPackagingPipelineStorage',
                   CELERY_EAGER_PROPAGATES_EXCEPTIONS=True,
                   CELERY_ALWAYS_EAGER=True,
                   BROKER_BACKEND='memory',)
class ErrorClassifierTests(TestCase):

    def setUp(self):

        # NOTE: we need real web pages, else the absolutization won't work or
        # will find duplicates and tests will fail for a real-life reason.
        # Here we need to keep an article without any url_error, so we have
        # to make it point to a real working URL.
예제 #5
0
 def tearDown(self):
     WebSite.drop_collection()
     Article.drop_collection()
예제 #6
0
 def tearDown(self):
     Article.drop_collection()
     User.drop_collection()
     Read.drop_collection()
     Feed.drop_collection()
예제 #7
0
 def tearDown(self):
     Subscription.drop_collection()
     Feed.drop_collection()
     Read.drop_collection()
     Article.drop_collection()
     User.drop_collection()
예제 #8
0
 def tearDown(self):
     WebSite.drop_collection()
     Article.drop_collection()
예제 #9
0
 def tearDown(self):
     Article.drop_collection()
     Feed.drop_collection()
예제 #10
0
 def tearDown(self):
     Subscription.drop_collection()
     Feed.drop_collection()
     Read.drop_collection()
     Article.drop_collection()
     User.drop_collection()
예제 #11
0
from oneflow.core.tasks import global_feeds_checker
from oneflow.base.utils import RedisStatsCounter
from oneflow.base.tests import (connect_mongodb_testsuite, TEST_REDIS)

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()
Group.drop_collection()
Feed.drop_collection()
Tag.drop_collection()
Folder.drop_collection()
WebSite.drop_collection()
Author.drop_collection()


class ThrottleIntervalTest(TestCase):
    def test_lower_interval_with_etag_or_modified(self):

        t = Feed.throttle_fetch_interval