-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Logic while exporting session CSV and add tests
- Loading branch information
1 parent
3d2a1eb
commit f09caa6
Showing
2 changed files
with
20 additions
and
4 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,14 +37,30 @@ def test_export_attendees_csv(self): | |
self.assertEqual(field_data[1][3], common.string_) | ||
self.assertEqual(field_data[1][5], '[email protected]') | ||
|
||
def _test_export_session_csv(self, test_session=None): | ||
with app.test_request_context(): | ||
if not test_session: | ||
test_session = SessionFactory() | ||
field_data = export_sessions_csv([test_session]) | ||
session_row = field_data[1] | ||
|
||
self.assertEqual(session_row[0], 'example (accepted)') | ||
self.assertEqual(session_row[7], 'accepted') | ||
|
||
def test_export_sessions_csv(self): | ||
"""Method to check sessions data export""" | ||
|
||
with app.test_request_context(): | ||
self._test_export_session_csv() | ||
|
||
def test_export_sessions_none_csv(self): | ||
"""Method to check sessions data export with no abstract""" | ||
|
||
with app.test_request_context(): | ||
test_session = SessionFactory() | ||
field_data = export_sessions_csv([test_session]) | ||
self.assertEqual(field_data[1][6], common.int_) | ||
self.assertEqual(field_data[1][7], 'accepted') | ||
test_session.long_abstract = None | ||
test_session.level = None | ||
self._test_export_session_csv(test_session) | ||
|
||
def test_export_speakers_csv(self): | ||
"""Method to check speakers data export""" | ||
|