Skip to content

Commit

Permalink
test(tests/): Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
setmao committed Feb 28, 2022
1 parent d75d78a commit 9b0d299
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ msgstr "live stream policy"

#: core/models.py:177
msgid "referring policy"
msgstr "referring policy"
msgstr "referral policy"

#: core/models.py:183
msgid "slide link"
Expand Down
7 changes: 1 addition & 6 deletions src/proposals/forms/proposals.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ class Meta(TutorialProposalMixin.Meta):
'recording_policy',
'live_stream_policy',
'prefer_time',
'pre_recorded_policy',
'living_in_taiwan',
'pre_recorded_policy',
]


Expand Down Expand Up @@ -123,9 +123,6 @@ class Meta(TalkProposalMixin.Meta):
'live_stream_policy',
'first_time_speaker',
'slide_link',
'referring_policy',
'prefer_time',
'living_in_taiwan',
]


Expand Down Expand Up @@ -158,8 +155,6 @@ class Meta(TutorialProposalMixin.Meta):
'recording_policy',
'live_stream_policy',
'slide_link',
'prefer_time',
'living_in_taiwan',
]


Expand Down
22 changes: 15 additions & 7 deletions src/proposals/tests/forms/test_proposal.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,23 @@ def talk_proposal_data():
'category': 'PRAC',
'duration': 'PREF15',
'language': 'ZHZH',
'talk_language': 'en',
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'referring_policy': True,
'first_time_speaker': True,
'living_in_taiwan': True,
'pre_recorded_policy': True,
}


def test_talk_proposal_create_form():
form = TalkProposalCreateForm()
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'python_level', 'recording_policy',
'live_stream_policy', 'first_time_speaker', 'referring_policy',
'title', 'category', 'duration', 'language', 'talk_language', 'python_level',
'recording_policy', 'live_stream_policy', 'first_time_speaker', 'referring_policy',
'prefer_time', 'living_in_taiwan', 'pre_recorded_policy',
]


Expand Down Expand Up @@ -65,17 +69,21 @@ def tutorial_proposal_data():
'category': 'PRAC',
'duration': 'HALFDAY',
'language': 'ZHZH',
'talk_language': 'en',
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'living_in_taiwan': True,
'pre_recorded_policy': True,
}


def test_tutorial_proposal_create_form():
form = TutorialProposalCreateForm()
assert list(form.fields) == [
'title', 'category', 'duration', 'language',
'title', 'category', 'duration', 'language', 'talk_language',
'python_level', 'recording_policy', 'live_stream_policy',
'prefer_time', 'living_in_taiwan', 'pre_recorded_policy',
]


Expand Down Expand Up @@ -114,10 +122,10 @@ def test_tutorial_proposal_create_form_valid(
def test_talk_proposal_update_form():
form = TalkProposalUpdateForm()
assert list(form.fields) == [
'title', 'category', 'duration', 'language', 'abstract', 'python_level',
'objective', 'detailed_description', 'outline', 'supplementary',
'recording_policy', 'live_stream_policy', 'first_time_speaker',
'slide_link', 'referring_policy',
'title', 'category', 'duration', 'language', 'talk_language',
'abstract', 'python_level', 'objective', 'detailed_description',
'outline', 'supplementary', 'recording_policy',
'live_stream_policy', 'first_time_speaker', 'slide_link',
]


Expand Down
6 changes: 6 additions & 0 deletions src/proposals/tests/views/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,14 @@ def test_talk_proposal_create_post(agreed_user, agreed_user_client):
'category': 'PRAC',
'duration': 'PREF15',
'language': 'ZHZH',
'talk_language': 'en',
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'referring_policy': False,
'first_time_speaker': True,
'living_in_taiwan': True,
'pre_recorded_policy': True,
}, follow=True)

proposal = TalkProposal.objects.get(
Expand All @@ -121,9 +124,12 @@ def test_tutorial_proposal_create_post(agreed_user, agreed_user_client):
'category': 'PRAC',
'duration': 'FULLDAY',
'language': 'ZHZH',
'talk_language': 'en',
'python_level': 'INTERMEDIATE',
'recording_policy': True,
'live_stream_policy': True,
'living_in_taiwan': True,
'pre_recorded_policy': True,
}, follow=True)

proposal = TutorialProposal.objects.get(
Expand Down

0 comments on commit 9b0d299

Please sign in to comment.