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

test:Add Integration tests for account delete functions #6108

Merged
merged 1 commit into from
Jun 28, 2019

Conversation

mrsaicharan1
Copy link
Member

Fixes #6107
Part of #5320

Short description of what this resolves:

Increases test coverage by adding integrations tests for user delete helper functions

Changes proposed in this pull request:

  • Added integration tests for user delete helper functions

Checklist

  • I have read the Contribution & Best practices Guide and my PR follows them.
  • My branch is up-to-date with the Upstream development branch.
  • The unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • All the functions created/modified in this PR contain relevant docstrings.



if __name__ == '__main__':
unittest.main()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 'unittest'

tests/all/integration/api/helpers/test_user.py Outdated Show resolved Hide resolved
tests/all/integration/api/helpers/test_user.py Outdated Show resolved Hide resolved
tests/all/integration/api/helpers/test_user.py Outdated Show resolved Hide resolved
@mrsaicharan1 mrsaicharan1 changed the title [WIP]test:Add Integration tests for account delete functions test:Add Integration tests for account delete functions Jun 27, 2019
@auto-label auto-label bot added the testing label Jun 27, 2019
@fossasia fossasia deleted a comment Jun 27, 2019
@fossasia fossasia deleted a comment Jun 27, 2019
@mrsaicharan1 mrsaicharan1 force-pushed the integration-tests branch 3 times, most recently from 46d3ab8 to 66c065e Compare June 27, 2019 03:55
@codecov
Copy link

codecov bot commented Jun 27, 2019

Codecov Report

Merging #6108 into development will increase coverage by 0.29%.
The diff coverage is 96.66%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #6108      +/-   ##
===============================================
+ Coverage        66.16%   66.45%   +0.29%     
===============================================
  Files              285      286       +1     
  Lines            14212    14242      +30     
===============================================
+ Hits              9403     9465      +62     
+ Misses            4809     4777      -32
Impacted Files Coverage Δ
tests/all/integration/api/helpers/test_user.py 96.66% <96.66%> (ø)
app/api/helpers/scheduled_jobs.py 27.36% <0%> (+4.21%) ⬆️
app/api/helpers/db.py 85.41% <0%> (+14.58%) ⬆️
app/api/helpers/user.py 100% <0%> (+75.86%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ae00ff...ecab241. Read the comment docs.

add test for user email modified when deleted

Add tests for user delete restore

Hound Issues

Added exception handling test
@mrsaicharan1
Copy link
Member Author

@iamareebjamal @uds5501 @shreyanshdwivedi Please review!

Copy link
Contributor

@uds5501 uds5501 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests look good!

save_to_db(user1)
user2 = create_user(email="test_user@gmail.com.deleted", password="testpass")
save_to_db(user2)
self.assertRaises(ForbiddenException, modify_email_for_user_to_be_restored, user2)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests LGTM 👍
@mrsaicharan1 just a query - Is the user2 passed to the function modify_email_for_user_to_be_restored by this line?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shreyanshdwivedi yes, that's how assertRaises works!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool. Approving

@mrsaicharan1
Copy link
Member Author

@iamareebjamal @CosmicCoder96 Please review.

@mrsaicharan1
Copy link
Member Author

@niranjan94 @CosmicCoder96 PLease have a look

@iamareebjamal iamareebjamal merged commit 5e5921c into fossasia:development Jun 28, 2019
iamareebjamal pushed a commit to iamareebjamal/open-event-server that referenced this pull request Aug 2, 2019
add test for user email modified when deleted

Add tests for user delete restore

Hound Issues

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

Successfully merging this pull request may close these issues.

test: Write tests for user delete helper functions
5 participants