-
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
base: develop
Are you sure you want to change the base?
Feature/public event #287
Conversation
…public attr to event model, a function that adds a user to existing event and test for that function.
…ntent given as a var, and also a func that sends email to all participants in event.
…t creation. fixing tests. tests are not working properly yet!
…still bugs inside
… event participants.
…into feature/public_event
@@ -61,8 +61,8 @@ class Event(Base): | |||
color = Column(String, nullable=True) | |||
availability = Column(Boolean, default=True, nullable=False) | |||
invitees = Column(String) | |||
is_public = Column(Boolean, default=False) |
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
|
||
|
||
@pytest.fixture | ||
def new_user(session): |
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.
maybe you can use existing fixtures?
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.
Tried but didn't really find a proper user fixture inside the file. ill try going over the code again
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.
There are enough user fixtures, use one of the others.
Codecov Report
@@ Coverage Diff @@
## develop #287 +/- ##
===========================================
- Coverage 98.01% 97.63% -0.39%
===========================================
Files 68 68
Lines 2979 3002 +23
===========================================
+ Hits 2920 2931 +11
- Misses 59 71 +12
Continue to review full report at Codecov.
|
…ead of bool of whether emails were send. tried simple tests for it
…sending is supposed to fail) and the second where event owner sends email
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.
Great job! Please see my insights, and use precommit hooks to format your code automatically :)
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.
Most of the problems in this version could be resolved easily using git precommit hooks.
Please run black
or git precommit hooks on this code and I'll check it again :)
app/internal/email.py
Outdated
templates, | ||
) | ||
from app.database.models import Event, User, UserEvent | ||
from app.internal.utils import get_current_user |
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.
Please use Kobi's user system instead
tests/conftest.py
Outdated
@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 |
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.
Don't create a new fixture, use one of the others.
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.
i have to use several different users since i'm testing the use of the mailing list.
tests/conftest.py
Outdated
@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 |
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.
Don't create a new fixture, use one of the others. You can use a user fixture and an event fixture in your code to create this.
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.
i have to use several different users since i'm testing the use of the mailing list.
__
tests/conftest.py
Outdated
@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 |
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.
Don't create a new user fixture, use one of the others.
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.
i have to use several different users since i'm testing mailing list.
tests/conftest.py
Outdated
@pytest.fixture | ||
def event_example(session, event_owning_user): | ||
data = { | ||
'title': 'test event title', | ||
'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/87538459r6', | ||
'content': 'content', | ||
'owner_id': event_owning_user.id, | ||
} | ||
|
||
event = create_event(session, **data) | ||
return event |
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.
Don't create a new event fixture, use one of the others.
|
||
|
||
@pytest.fixture | ||
def new_user(session): |
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.
There are enough user fixtures, use one of the others.
…ndar into feature/public_event
…into feature/public_event
a feature that supports describing an event as a public event. as a part of this definition, it will allow sending emails to all event participants and allow joining events on the event page.