コード例 #1
0
ファイル: test_auth.py プロジェクト: stxnext-csr/volontulo
    def test__register_authenticated_user(self):
        u"""Check if authenticated user can access register page."""
        # volunteer user
        common.initialize_empty_volunteer()

        self.client.post('/login', {
            'email': '*****@*****.**',
            'password': '******',
        })
        response = self.client.get('/login', follow=True)

        self.assertRedirects(
            response,
            '/',
            302,
            200,
        )
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            ('http://testserver/', 302),
        )
        self.assertIn('_auth_user_id', self.client.session)
        self.assertContains(
            response,
            u'Jesteś już zalogowany.'
        )
コード例 #2
0
 def setUpTestData(cls):
     # volunteer user - totally useless
     common.initialize_empty_volunteer()
     # organization user - no offers
     common.initialize_empty_organization()
     # volunteer user - badges, offers, organizations
     common.initialize_filled_volunteer_and_organization()
コード例 #3
0
 def setUpTestData(cls):
     # volunteer user - totally useless
     common.initialize_empty_volunteer()
     # organization user - no offers
     common.initialize_empty_organization()
     # volunteer user - offers, organizations
     common.initialize_filled_volunteer_and_organization()
コード例 #4
0
    def test__register_authenticated_user(self):
        """Check if authenticated user can access register page."""
        # volunteer user
        common.initialize_empty_volunteer()

        self.client.post('/o/login', {
            'email': '*****@*****.**',
            'password': '******',
        })
        response = self.client.get('/o/login', follow=True)

        self.assertRedirects(
            response,
            '/o',
            302,
            200,
        )
        self.assertEqual(len(response.redirect_chain), 1)
        self.assertEqual(
            response.redirect_chain[0],
            ('/o', 302),
        )
        self.assertIn('_auth_user_id', self.client.session)
        self.assertContains(
            response,
            'Jesteś już zalogowany.'
        )
コード例 #5
0
 def setUpTestData(cls):
     u"""Data fixtures for all tests."""
     # volunteer user - totally useless
     cls.volunteer = common.initialize_empty_volunteer()
     # organization user - no offers
     cls.organization = common.initialize_empty_organization()
     # volunteer user - offers, organizations
     cls.volunteer2, cls.organization2 = \
         common.initialize_filled_volunteer_and_organization()
コード例 #6
0
 def setUpTestData(cls):
     """Data fixtures for all tests."""
     # volunteer user - totally useless
     cls.volunteer = common.initialize_empty_volunteer()
     # organization user - no offers
     cls.organization = common.initialize_empty_organization()
     # volunteer user - offers, organizations
     cls.volunteer2, cls.organization2 = \
         common.initialize_filled_volunteer_and_organization()
コード例 #7
0
 def setUpTestData(cls):
     # admin user
     cls.admin = common.initialize_administrator(
         username=cls.test_admin_username,
         email=cls.test_admin_email,
         password=cls.test_admin_password)
     # volunteer user - totally useless
     cls.volunteer = common.initialize_empty_volunteer()
     # organization user - no offers
     common.initialize_empty_organization()
     # volunteer user - offers, organizations
     common.initialize_filled_volunteer_and_organization()
コード例 #8
0
 def setUpTestData(cls):
     # admin user
     cls.admin = common.initialize_administrator(
         username=cls.test_admin_username, email=cls.test_admin_email,
         password=cls.test_admin_password
     )
     # volunteer user - totally useless
     cls.volunteer = common.initialize_empty_volunteer()
     # organization user - no offers
     common.initialize_empty_organization()
     # volunteer user - offers, organizations
     common.initialize_filled_volunteer_and_organization()
コード例 #9
0
ファイル: test_auth.py プロジェクト: stxnext-csr/volontulo
 def setUpTestData(cls):
     u"""Set up fixtures data for test."""
     # volunteer user
     common.initialize_empty_volunteer()
コード例 #10
0
ファイル: test_auth.py プロジェクト: maciekz/volontulo
 def setUpTestData(cls):
     u"""Set up fixtures data for test."""
     # volunteer user
     common.initialize_empty_volunteer()
コード例 #11
0
 def setUp(self):
     """UnitTest setup data."""
     common.initialize_empty_volunteer()
コード例 #12
0
 def setUp(self):
     u"""UnitTest setup data."""
     common.initialize_empty_volunteer()