-
Notifications
You must be signed in to change notification settings - Fork 1
Write unit test suite #170
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
Conversation
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.
Thanks @Joe-Heffer-Shef, I've also added all the base permission tests which has now been merged into the dev branch. Also added factoryboy for creating test objects. Can you integrate them into this PR?
Also let's use the |
Converted to draft while I merged in Twin's unit tests with what I've written. |
Is this some issue with resolving the URLs? Is it getting confused between SORT/survey/tests/test_survey_views.py Lines 98 to 99 in a6efc2b
Lines 56 to 61 in a6efc2b
|
@Joe-Heffer-Shef I think everything related to email invitations need a proper review altogether. It was something implemented very early on but so much has changed that something probably broke along the way. I made an issue #89 for this exact reason. I'd be tempted to just leave the invitation tests to be done in that issue. |
Okay, I've disabled the invite tests for now, which can be implemented separately with issue #89. These tests all pass now. There might be some details that I've overlooked but the code coverage should be alright for now! (We could measure this.) |
# Conflicts: # README.md # SORT/settings.py # assets/sort-survey-configurator/README.md # assets/sort-survey-configurator/package-lock.json # home/templatetags/vite_integration.py # survey/services/survey.py
# Conflicts: # SORT/settings.py
Add invitation view tests
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 few minor changes need for the test class names but the rest is looking good. Let's get this merged in!
|
||
def test_add_user_to_organisation(self): | ||
""" | ||
Check that an organisation administrator can add another user to that organisation. |
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 manager won't be adding a user directly. They'll need to send an invite that generates the code, the user can then add themselves to the organisation if they have the correct code.
from survey.services import SurveyService | ||
|
||
|
||
class SurveyServiceTestCase(SORT.test.test_case.ViewTestCase): |
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.
Rename to SurveyViewsTestcase?
from survey.services import SurveyService | ||
|
||
|
||
class SurveyServiceTestCase(SORT.test.test_case.ViewTestCase): |
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.
Rename to InvitationViewTestCase?
# Conflicts: # SORT/settings.py # home/tests/model_factory.py # home/tests/test_services.py # requirements.txt # survey/services/survey.py # survey/tests/test_models.py
I accidentally merged this without resolving the issues above, sorry @twinkarma! I'll sort out the issues (no pun intended) next week. |
Changes:
unittest.TestCase
base classes for views and servicesThe invite tests are currently disabled.