-
Notifications
You must be signed in to change notification settings - Fork 52
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
Feature/public event #287
Open
noam-y
wants to merge
41
commits into
PythonFreeCourse:develop
Choose a base branch
from
noam-y:feature/public_event
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Feature/public event #287
Changes from all commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
5ef6469
basic restoration of code from a deleted branch. includes- adding is_…
noam-y 885a843
added 2 functions- one to send an adaptable email, with email body co…
noam-y 1f4b084
added front end button to allow users to join event, not connected to…
noam-y 8e0d1ee
adding testing fixtures
noam-y 5a8adeb
adding working user and event fixture, adding is_public param to even…
noam-y 59532d6
subtle changes for debugging add_user_to_event failing tests.
noam-y 235c4b2
added something that prevents adding null event_id to userevent objects.
noam-y d32ca25
fixed a small bug that made one of the tests fail
noam-y ef0f679
added func that send email to participants given event id- there are …
noam-y c6477a5
email not working- last commit before rebuild
noam-y b7cc686
merged changes
noam-y 540f1bf
merged with current changes + added one func that sends emails to all…
noam-y 49ac8e7
improved documentation
noam-y e111110
adds feature that makes sure only the event owner can send email to a…
noam-y 573cd2b
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
noam-y 847eb09
merged changes w pulled code
noam-y b9d6016
Merge branch 'develop' into feature/public_event
yammesicka e715f4c
merging conflicts
noam-y 14fc7e2
merge with code
noam-y f515361
trying to add is_public feature to telegram create event bot
noam-y e4f2ee0
creating more changes to enable public feature on create event func o…
noam-y 9ffa3ea
last chance to add telegram feature- will be deleted soon...
noam-y e8571f1
reverting changes made on telegram
noam-y 05c90a1
merging changes from pulled code
noam-y 71ee772
changed email sending function to depend on send function so its more…
noam-y 9cf15b1
moving user and event fixtures to conftest.py so we can use them glob…
noam-y 70be019
changing mailing list sender to return the number of emails sent inst…
noam-y 1bc712c
making test to assert failure of sending mailing list with no logged …
noam-y f371ce1
merging conflicts
noam-y 05310b7
splitting mailing list send to 2 tests- one where no user is logged (…
noam-y c02ffd0
small pep changes
noam-y 8a58f78
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
noam-y b6ff758
deleting some visual comments according to yam's commends + hooks
noam-y 093881b
trying to add precommit hooks
noam-y 7b4ee13
merge conflicts
noam-y 986b43b
Merge branch 'feature/public_event' of https://github.com/noam-y/cale…
noam-y cf5b771
finally merged conflicts
noam-y 76db81a
added guards and small changes
noam-y 9bbed18
Merge branch 'develop' of https://github.com/PythonFreeCourse/calenda…
noam-y 94c4a32
first try of adding koby's user system to event mailing list send
noam-y b08636e
moving user fixtures from conftest to user_fixtures.
noam-y File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from datetime import datetime | ||
from typing import Generator | ||
|
||
import pytest | ||
|
@@ -6,7 +7,8 @@ | |
from app.database.models import User | ||
from app.database.schemas import UserCreate | ||
from app.internal.utils import create_model, delete_instance | ||
from app.routers.register import create_user | ||
from app.routers.event import create_event | ||
from app.routers.register import _create_user, create_user | ||
|
||
|
||
@pytest.fixture | ||
|
@@ -38,3 +40,55 @@ def sender(session: Session) -> Generator[User, None, None]: | |
) | ||
yield mock_user | ||
delete_instance(session, mock_user) | ||
|
||
|
||
@pytest.fixture | ||
def no_event_user(session): | ||
"""a user made for testing who doesn't own any event.""" | ||
user = _create_user( | ||
session=session, | ||
username="new_test_username", | ||
password="new_test_password", | ||
email="[email protected]", | ||
language_id="english", | ||
) | ||
|
||
return user | ||
|
||
|
||
@pytest.fixture | ||
def event_owning_user(session): | ||
"""a user made for testing who already owns an event.""" | ||
user = _create_user( | ||
session=session, | ||
username="new_test_username2", | ||
password="new_test_password2", | ||
email="[email protected]", | ||
language_id="english", | ||
) | ||
|
||
data = { | ||
"title": "event_owning_user event", | ||
"start": datetime.strptime("2021-05-05 14:59", "%Y-%m-%d %H:%M"), | ||
"end": datetime.strptime("2021-05-05 15:01", "%Y-%m-%d %H:%M"), | ||
"location": "https://us02web.zoom.us/j/875384596", | ||
"content": "content", | ||
"owner_id": user.id, | ||
} | ||
|
||
create_event(session, **data) | ||
|
||
return user | ||
|
||
|
||
@pytest.fixture | ||
def user1(session): | ||
"""another user made for testing""" | ||
user = _create_user( | ||
session=session, | ||
username="user2user2", | ||
password="verynicepass", | ||
email="[email protected]", | ||
language_id="english", | ||
) | ||
return user |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event doesn't have "friends" option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the meaning of friends is different- public event is meant to allow any user in the platform to join the event, just like the public events on facebook. so it means the owner's friends don't matter in this feature :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please explain what is the meaning of public/private event? is it like busy/free?
Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a pubic event is event anyone can join. it means you don't need to be invited directly from the owner, you can join the event by yourself by clicking a button on event page