Skip to content

Conversation

@mrsaicharan1
Copy link
Member

@mrsaicharan1 mrsaicharan1 commented Jan 16, 2019

Fixes #5320

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.

Short description of what this resolves:

Builds up on the code coverage and testability of the authentication feature.

Changes proposed in this pull request:

  • Added test for authentication to build up on the code coverage.

with app.test_request_context():
auth_manager = AuthManager()
auth_manager.init_login(app)
user = create_user(email = '[email protected]', password = 'password')

Choose a reason for hiding this comment

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

unexpected spaces around keyword / parameter equals

"""Method to test the registered user details"""

with app.test_request_context():
auth_manager = AuthManager()

Choose a reason for hiding this comment

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

'AuthManager' may be undefined, or defined from star imports: app.api.helpers.auth

from tests.all.integration.auth_helper import create_user
from app.api.helpers.db import save_to_db
from tests.all.integration.utils import OpenEventTestCase
from app.api.helpers.auth import *

Choose a reason for hiding this comment

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

'from app.api.helpers.auth import *' used; unable to detect undefined names

@@ -0,0 +1,21 @@
from app import current_app as app
from tests.all.integration.auth_helper import create_user
from app.api.helpers.db import save_to_db

Choose a reason for hiding this comment

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

'app.api.helpers.db.save_to_db' imported but unused

with app.test_request_context():
auth_manager = auth.AuthManager()
auth_manager.init_login(app)
user = create_user(email = '[email protected]', password = 'password')

Choose a reason for hiding this comment

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

unexpected spaces around keyword / parameter equals

@codecov
Copy link

codecov bot commented Jan 17, 2019

Codecov Report

Merging #5517 into development will increase coverage by 0.07%.
The diff coverage is 94.73%.

Impacted file tree graph

@@               Coverage Diff               @@
##           development    #5517      +/-   ##
===============================================
+ Coverage        63.03%   63.11%   +0.07%     
===============================================
  Files              264      265       +1     
  Lines            12702    12721      +19     
===============================================
+ Hits              8007     8029      +22     
+ Misses            4695     4692       -3
Impacted Files Coverage Δ
tests/all/integration/api/helpers/test_auth.py 94.73% <94.73%> (ø)
app/api/helpers/auth.py 78.94% <0%> (+5.26%) ⬆️
tests/all/integration/auth_helper.py 58.33% <0%> (+25%) ⬆️

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 a937775...474d177. Read the comment docs.

@abhinavk96 abhinavk96 merged commit 638f757 into fossasia:development Jan 20, 2019
mrsaicharan1 pushed a commit to mrsaicharan1/open-event-server that referenced this pull request Jan 30, 2019
…ia#5512)

Added package in local installation docs

Added test for authentication

Added docstring for auth test

Unused modules of auth test removed

Added package in local installation docs (fossasia#5515)

Changed module import style

test exception handled

User import

Whitespace commit

Export csv support for sessions

Add test database instructions

Update local.md

Added test for authentication (fossasia#5517)

* Added package in local installation docs

* Added test for authentication

* Added docstring for auth test

* Unused modules of auth test removed

* Changed module import style

* test exception handled

* User import

* Whitespace commit

Remove authorisation constraint for discount and access code list

Fix Admin Sales Api (fossasia#5528)

Add hooks for admin statistics (fossasia#5530)

removed unused packages

continuation line indent'

removed test doc commmit to separate PR

Removed redundant print statement

Add seed data for custom placeholders (fossasia#5533)

Disable registrat constraint to update attendees (fossasia#5544)

Frontend follows a flow where non registrar user has to edit an attendee while placing an order.

remove marketer and service fee constraints

Currently, the APIs are not functioning correctly with these intricate configurations.

docs(api): Remove unused line no 24100 in API blueprint (fossasia#5541)

Orders API: Remove verified user constraint (fossasia#5548)

Lax permissions to view discount codes (fossasia#5551)

Read from environment variables when creating the super admin user

Added test database docs for running tests locally (fossasia#5539)

* Added package in local installation docs

* Added test for authentication

* Added docstring for auth test

* Unused modules of auth test removed

* Changed module import style

* test exception handled

* User import

* Whitespace commit

* Add test database instructions

* Update local.md

* Export csv support for sessions

* removed unused packages

* continuation line indent'

* removed test doc commmit to separate PR

* Added test database docs

* Added instructions for test database docs

Removed stream response

removed unnecessary import

Add seed data for custom placeholders (fossasia#5533)

Disable registrat constraint to update attendees (fossasia#5544)

Frontend follows a flow where non registrar user has to edit an attendee while placing an order.

remove marketer and service fee constraints

Currently, the APIs are not functioning correctly with these intricate configurations.

docs(api): Remove unused line no 24100 in API blueprint (fossasia#5541)

Orders API: Remove verified user constraint (fossasia#5548)

Lax permissions to view discount codes (fossasia#5551)

Read from environment variables when creating the super admin user

Added test database docs

Added fields for csv export sessions
mrsaicharan1 added a commit to mrsaicharan1/open-event-server that referenced this pull request Jan 30, 2019
* Added package in local installation docs

* Added test for authentication

* Added docstring for auth test

* Unused modules of auth test removed

* Changed module import style

* test exception handled

* User import

* Whitespace commit
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.

Improve the testability of the project by adding unit tests

4 participants