示例#1
0
    def test_get_participant_gets_participant(self):
        expected = TwitterAccount(self.db, "alice",
                                  {}).opt_in("alice")[0].participant
        request = load_request(b'/alice/')

        actual = utils.get_participant(request, restrict=False)
        assert actual == expected
示例#2
0
    def test_get_participant_canonicalizes(self):
        expected, ignored = TwitterAccount("alice", {}).opt_in("alice")
        request = load_request('/Alice/')

        with self.assertRaises(Response) as cm:
            utils.get_participant(request, restrict=False)
        actual = cm.exception.code
        assert actual == 302, actual
示例#3
0
    def test_get_participant_canonicalizes(self):
        expected, ignored = TwitterAccount("alice", {}).opt_in("alice")
        request = load_request(b'/Alice/')

        with self.assertRaises(Response) as cm:
            utils.get_participant(request, restrict=False)
        actual = cm.exception.code
        assert actual == 302
示例#4
0
    def test_get_participant_gets_participant(self):
        expected = TwitterAccount("alice", {}).opt_in("alice")[0].participant
        request = load_request(b'/alice/')

        actual = utils.get_participant(request, restrict=False)
        assert actual == expected