Ejemplo n.º 1
0
    def tearDown(self):
        self.client.logout()

        Subscription.drop_collection()
        Read.drop_collection()
        Folder.drop_collection()
        Preferences.drop_collection()
        User.drop_collection()
Ejemplo n.º 2
0
    def setUp(self):
        self.client = Client()

        # WARNING: it doesn't work as expected
        # when this user is created in setUpClass().
        self.django_user = DjangoUser.objects.create_user(
            username='******', password='******',
            email='*****@*****.**')

        # MongoDB user has been auto created.
        self.mongodb_user = self.django_user.mongo

        self.subscriptions = []
        self.folders       = []

        for feed in self.feeds:
            self.subscriptions.append(
                Subscription.subscribe_user_to_feed(self.mongodb_user, feed)
            )

        for folder_name in (u'Folder #1', u'Folder #2', u'Folder #3',
                            u'Folder #4', u'Folder #5', u'Folder #6'):
            self.folders.append(
                Folder.add_folder(folder_name, self.mongodb_user)[0]
            )