コード例 #1
0
    def setUp(self):

        self.django_user1 = DjangoUser.objects.create_user(
            username='******',
            password='******',
            email='*****@*****.**')

        self.django_user2 = DjangoUser.objects.create_user(
            username='******',
            password='******',
            email='*****@*****.**')

        self.django_user3 = DjangoUser.objects.create_user(
            username='******',
            password='******',
            email='*****@*****.**')

        # Auto-created on PG's post_save().
        self.alice = self.django_user1.mongo
        self.bob = self.django_user2.mongo
        self.john = self.django_user3.mongo

        self.alice_friends = Group(name="Alice's friends",
                                   creator=self.alice).save()
        self.alice_work = Group(name="Alice's co-workers",
                                creator=self.alice).save()
        self.bob_friends = Group(name="Bob's friends", creator=self.bob).save()
        self.john_friends = Group(name="John's friends",
                                  creator=self.john).save()
コード例 #2
0
ファイル: test_models.py プロジェクト: EliotBerriot/1flow
 def tearDown(self):
     User.drop_collection()
     Group.drop_collection()
コード例 #3
0
ファイル: test_models.py プロジェクト: EliotBerriot/1flow
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

        some_news = 10
        no_dupe   = 0
コード例 #4
0
 def tearDown(self):
     User.drop_collection()
     Group.drop_collection()
コード例 #5
0
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

        some_news = 10
        no_dupe = 0
        no_mutual = 0