Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remember created project #1193

Merged
merged 2 commits into from
Jul 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions ihatemoney/tests/budget_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ def test_invite(self):
resp = self.client.get("/raclette/join/token.invalid", follow_redirects=True)
self.assertIn("Provided token is invalid", resp.data.decode("utf-8"))

def test_create_should_remember_project(self):
"""Test that creating a project adds it to the "logged in project" list,
as it does for authentication
"""
self.login("raclette")
self.post_project("raclette")
self.post_project("tartiflette")
data = self.client.get("/raclette/").data.decode("utf-8")
self.assertEqual(data.count('href="/tartiflette/"'), 1)

def test_multiple_join(self):
"""Test that joining multiple times a project
doesn't add it multiple times in the session"""
Expand Down
3 changes: 1 addition & 2 deletions ihatemoney/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ def create_project():
db.session.commit()

# create the session object (authenticate)
session[project.id] = True
session.update()
set_authorized_project(project)

# send reminder email
g.project = project
Expand Down
Loading