Skip to content

Commit

Permalink
fix small typo and change the contribution docs (#291)
Browse files Browse the repository at this point in the history
* fix small typo and change the contribution docs

* fix tests with the latest Piccolo ORM changes

* remove accidentally left postgres password
  • Loading branch information
sinisaos authored Jul 31, 2024
1 parent 5634e77 commit cd4a8f4
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 16 deletions.
3 changes: 2 additions & 1 deletion docs/source/contributing/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The docs are written using Sphinx. To get them running locally:
* Install the requirements: ``pip install -r requirements/doc-requirements.txt``
* ``cd docs``
* Do an initial build of the docs: ``make html``
* Serve the docs: ``scripts/run-docs.sh``
* ``cd ..``
* Serve the docs: ``./scripts/run-docs.sh``
* The docs will auto rebuild as you make changes.

-------------------------------------------------------------------------------
Expand Down
18 changes: 9 additions & 9 deletions docs/source/register/endpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Here's a Starlette example:
app = Starlette()
app.mount('/register/', register(redirect_to="/login/"))
app.mount("/register/", register(redirect_to="/login/"))
Here's a FastAPI example:

Expand All @@ -43,7 +43,7 @@ Here's a FastAPI example:
app = FastAPI()
app.mount('/register/', register(redirect_to="/login/"))
app.mount("/register/", register(redirect_to="/login/"))
Security
~~~~~~~~
Expand All @@ -70,7 +70,7 @@ Modifying the FastAPI example above:
app = FastAPI()
app.mount(
'/register/',
"/register/",
RateLimitingMiddleware(
register(redirect_to="/login/"),
InMemoryLimitProvider(
Expand Down Expand Up @@ -104,24 +104,24 @@ following:
# To use hCaptcha:
app.mount(
'/register/',
"/register/",
register(
redirect_to="/login/",
captcha=hcaptcha(
site_key='my-site-key',
secret_key='my-secret-key',
site_key="my-site-key",
secret_key="my-secret-key",
)
)
)
# To use reCAPTCHA:
app.mount(
'/register/',
"/register/",
register(
redirect_to="/login/",
captcha=recaptcha_v2(
site_key='my-site-key',
secret_key='my-secret-key',
site_key="my-site-key",
secret_key="my-secret-key",
)
)
)
Expand Down
8 changes: 4 additions & 4 deletions docs/source/session_auth/endpoints.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Here's a Starlette example:
app = Starlette()
app.mount('/login/', session_login())
app.mount("/login/", session_login())
Here's a FastAPI example:

Expand All @@ -57,7 +57,7 @@ Here's a FastAPI example:
app = FastAPI()
app.mount('/login/', session_login())
app.mount("/login/", session_login())
Source
~~~~~~
Expand Down Expand Up @@ -95,7 +95,7 @@ Here's a Starlette example:
app = Starlette()
app.mount('/logout/', session_logout())
app.mount("/logout/", session_logout())
Here's a FastAPI example:

Expand All @@ -106,7 +106,7 @@ Here's a FastAPI example:
app = FastAPI()
app.mount('/login/', session_logout())
app.mount("/logout/", session_logout())
Source
Expand Down
6 changes: 4 additions & 2 deletions tests/crud/test_crud_endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def test_patch_user_fails(self):

response = client.patch(f"/{user['id']}/", json=json)
self.assertEqual(response.status_code, 400)
self.assertEqual(response.content, b"The password is too short.")
self.assertEqual(
response.content, b"The password is too short. (min 6)"
)

def test_patch_fails(self):
"""
Expand Down Expand Up @@ -1353,7 +1355,7 @@ def test_post_user_fails(self):

response = client.post("/", json=json)
self.assertEqual(
response.content, b"Error: The password is too short."
response.content, b"Error: The password is too short. (min 6)"
)
self.assertEqual(response.status_code, 400)

Expand Down

0 comments on commit cd4a8f4

Please sign in to comment.