Skip to content
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

Unit tests for Job app #54

Merged
merged 4 commits into from
Jun 25, 2021
Merged

Unit tests for Job app #54

merged 4 commits into from
Jun 25, 2021

Conversation

MAM-SYS
Copy link
Contributor

@MAM-SYS MAM-SYS commented Jun 14, 2021

hello friends
i wrote some unit tests for Views and Models of Job application for #12
hope it can help
I can also change anything you think is needed in these tests to get better
✌️

@sbabashahi
Copy link
Member

Hello dear @MAM-SYS

sorry for late response, I will check your MR asap.

@MAM-SYS
Copy link
Contributor Author

MAM-SYS commented Jun 16, 2021

thank you @sbabashahi
Let me know if there is anything needs to be fix in UnitTests
i will make it better

job/tests/test_views.py Outdated Show resolved Hide resolved
job/tests/test_views.py Outdated Show resolved Hide resolved
job/tests/test_views.py Outdated Show resolved Hide resolved
job/tests/test_views.py Outdated Show resolved Hide resolved
job/tests/test_views.py Outdated Show resolved Hide resolved
@sbabashahi
Copy link
Member

First of all thanks for your contribution :) and sorry again for late response.

  1. These tests are not unit tests, they are integration and functional tests, it's not a big deal, we appreciate writing any type of test.
  2. it could be a good practice to create a special DJANGO_SETTINGS_MODULE for testing (because you are the first one writing test and it could help others) a quick hint:
    write a tests.py in settings and in manage.py something like:

if 'test' in sys.argv: os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ratecompany.settings.tests') else: os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'ratecompany.settings.development')
3. Hint for unit test, test for default, required and optional fields.
As I said we appreciate your work and we could merge it right when you resolve conversations, but if you could improve it (add test settings and more test) we could wait. so your call :)

@MAM-SYS
Copy link
Contributor Author

MAM-SYS commented Jun 17, 2021

@sbabashahi
thank you boss.thanks for your guidance
certainly i will add and change them as you suggested to be better
it's my pleasure

@MAM-SYS
Copy link
Contributor Author

MAM-SYS commented Jun 18, 2021

Hello friends @sbabashahi
i fixed the codes as you mentioned
hope it is better now
but if still anything else that needs to be fix or add; just say
have a good Friday

ratecompany/settings/tests.py Show resolved Hide resolved
job/tests/test_views.py Outdated Show resolved Hide resolved
@sbabashahi
Copy link
Member

@MAM-SYS Sorry to keep you waiting, I will check it asap.

@MAM-SYS
Copy link
Contributor Author

MAM-SYS commented Jun 24, 2021

thanks a lot @sbabashahi
if anything need to change, tell me.even all of the code

@sbabashahi
Copy link
Member

@MAM-SYS well done :) i approve it in this state. I add some hints that may help us work better

  1. Try to set an in cache db for test
  2. Separate func test dir from unit test

@sbabashahi sbabashahi merged commit 492ba2e into jobguywork:develop Jun 25, 2021
@MAM-SYS
Copy link
Contributor Author

MAM-SYS commented Jun 25, 2021

@sbabashahi thanks again for your help in this issue
i consider your hints for my other pull requests for tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants