def test_add_strips_spaces(self, pyramid_request, users):
        pyramid_request.params = {
            "add": "   eva   ",
            "authority": "     foo.org   "
        }

        staff_add(pyramid_request)

        assert users["eva"].staff
예제 #2
0
파일: staff_test.py 프로젝트: hypothesis/h
    def test_add_is_idempotent(self, pyramid_request, users):
        pyramid_request.params = {
            "add": "agnos",
            "authority": pyramid_request.default_authority,
        }

        staff_add(pyramid_request)

        assert users["agnos"].staff
    def test_add_is_idempotent(self, pyramid_request, users):
        pyramid_request.params = {
            "add": "agnos",
            "authority": pyramid_request.default_authority,
        }

        staff_add(pyramid_request)

        assert users["agnos"].staff
예제 #4
0
파일: staff_test.py 프로젝트: hypothesis/h
    def test_add_flashes_when_user_not_found(self, pyramid_request):
        pyramid_request.params = {
            "add": "florp",
            "authority": pyramid_request.default_authority,
        }
        pyramid_request.session.flash = mock.Mock()

        staff_add(pyramid_request)

        assert pyramid_request.session.flash.call_count == 1
    def test_add_flashes_when_user_not_found(self, pyramid_request):
        pyramid_request.params = {
            "add": "florp",
            "authority": pyramid_request.default_authority,
        }
        pyramid_request.session.flash = mock.Mock()

        staff_add(pyramid_request)

        assert pyramid_request.session.flash.call_count == 1
예제 #6
0
파일: staff_test.py 프로젝트: hypothesis/h
    def test_add_redirects_to_index_when_user_not_found(self, pyramid_request):
        pyramid_request.params = {
            "add": "florp",
            "authority": pyramid_request.default_authority,
        }

        result = staff_add(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
        assert result.location == "/adm/staff"
    def test_add_redirects_to_index_when_user_not_found(self, pyramid_request):
        pyramid_request.params = {
            "add": "florp",
            "authority": pyramid_request.default_authority,
        }

        result = staff_add(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
        assert result.location == "/adm/staff"
예제 #8
0
    def test_add_redirects_to_index(self, pyramid_request):
        pyramid_request.params = {
            "add": "eva",
            "authority": pyramid_request.default_authority
        }

        result = staff_add(pyramid_request)

        assert isinstance(result, httpexceptions.HTTPSeeOther)
        assert result.location == '/adm/staff'
예제 #9
0
파일: staff_test.py 프로젝트: hypothesis/h
    def test_add_strips_spaces(self, pyramid_request, users):
        pyramid_request.params = {"add": "   eva   ", "authority": "     foo.org   "}

        staff_add(pyramid_request)

        assert users["eva"].staff
예제 #10
0
    def test_add_makes_users_staff(self, pyramid_request, users):
        pyramid_request.params = {"add": "eva", "authority": "foo.org"}

        staff_add(pyramid_request)

        assert users['eva'].staff