示例#1
0
    def test_index_not_logged_in(self):
        from pyconca.views import index

        info = index(self.request)

        self.assertEquals(None, info['logged_in'])
        self.assertFalse(info['is_admin'])
示例#2
0
    def test_index_logged_in_speaker(self):
        from pyconca.views import index

        with transaction.manager:
            self._loggedInStaff()
            info = index(self.request)

        self.assertEquals('pyramid_speaker', info['logged_in'])
        self.assertFalse(info['is_admin'])
示例#3
0
    def test_index_logged_in_admin(self):
        from pyconca.views import index

        with transaction.manager:
            self._loggedInAdmin()
            info = index(self.request)

        self.assertEquals('pyramid_admin', info['logged_in'])
        self.assertTrue(info['is_admin'])