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

feat : add validations #1096

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open

Conversation

epicadk
Copy link
Member

@epicadk epicadk commented May 8, 2021

Description

Fixes #1083

Type of Change:

  • Code

Code/Quality Assurance Only

  • New feature (non-breaking change which adds functionality pre-approved by mentors)

How Has This Been Tested?

ran tests

Checklist:

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials

Code/Quality Assurance Only

  • My changes generate no new warnings
  • My PR currently breaks something (fix or feature that would cause existing functionality to not work as expected)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been published in downstream modules

@codecov
Copy link

codecov bot commented May 9, 2021

Codecov Report

Merging #1096 (e0af4f7) into develop (ee009cf) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1096      +/-   ##
===========================================
+ Coverage    92.90%   93.00%   +0.09%     
===========================================
  Files           38       38              
  Lines         2073     2102      +29     
===========================================
+ Hits          1926     1955      +29     
  Misses         147      147              
Impacted Files Coverage Δ
app/database/models/mentorship_relation.py 100.00% <100.00%> (ø)
app/database/models/task_comment.py 96.15% <100.00%> (+0.69%) ⬆️
app/database/models/user.py 98.79% <100.00%> (+0.22%) ⬆️

@epicadk epicadk added the Status: Needs Review PR needs an additional review or a maintainer's review. label May 9, 2021
@@ -45,7 +44,7 @@ def test_second_user_cannot_be_admin(self):
user = UserModel.query.filter_by(email="[email protected]").first()
self.assertTrue(user is not None)
self.assertTrue(user.id is not None)
self.assertTrue(user.name == "User1")
self.assertTrue(user.name == "UserA")
Copy link
Member

Choose a reason for hiding this comment

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

What's the reason for changing name from User1 to UserA?

Copy link
Member Author

@epicadk epicadk May 14, 2021

Choose a reason for hiding this comment

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

User1 is not a valid name.
Refer

For the "name" field to be valid, it may contain one or more character from:
- letter "a" to "z" and/or "A" to "Z",
- any of the whitespace characters, and/or
- special character "-".

Copy link
Member

@devkapilbansal devkapilbansal left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@isabelcosta
Copy link
Member

@epicadk can you please resolve conflicts here. I'm sorry I've missed this PR, and I am happy to review and approve :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Review PR needs an additional review or a maintainer's review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use sql alchemy events to validate data
3 participants