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(signup-validations): Implement validations #10

Merged
merged 1 commit into from
Sep 7, 2018

Conversation

huxaiphaer
Copy link
Contributor

@huxaiphaer huxaiphaer commented Sep 5, 2018

What does this PR do?

Implements signup validation.

Description of Task to be completed?

Validating username, email, and password when the user is registering to the application.

How should this be manually tested?

  1. This can be manually (locally) tested by using this URL http://127.0.0.1:8000/api/users/ with a POST method in Postman,
  2. Then, you define your JSON body data as below to REGISTER.
{"user": {
                    "username": "lutaaya1" ,
                    "email": "lutaaya2@gmail.com",
                    "password": "12345554l"
          }
          
}

What are the relevant pivotal tracker stories?

159952001

@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 5, 2018 19:52 Inactive
@coveralls
Copy link

coveralls commented Sep 5, 2018

Pull Request Test Coverage Report for Build 267

  • 46 of 50 (92.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.5%) to 94.933%

Changes Missing Coverage Covered Lines Changed/Added Lines %
authors/apps/authentication/serializers.py 14 18 77.78%
Totals Coverage Status
Change from base Build 190: -0.5%
Covered Lines: 356
Relevant Lines: 375

💛 - Coveralls

@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 5, 2018 19:56 Inactive
@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 5, 2018 19:58 Inactive
@huxaiphaer huxaiphaer changed the title implement validations feat(signup-validations): Implement validations Sep 5, 2018
@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 5, 2018 20:05 Inactive
@collinewait
Copy link

collinewait commented Sep 6, 2018

Great work though code climate shows some mentainablity issues shown bellow:

screen shot 2018-09-06 at 10 03 37

@collinewait
Copy link

Travis is failing.

def test_api_can_login_a_user(self):
"""Test the api can login a user."""
self.response = self.client.post(
"/api/users/login/",
self.login_data,

Choose a reason for hiding this comment

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

Why was this line deleted?

@@ -19,15 +19,15 @@ def setUp(self):
self.user_data,
format="json")

def test_api_can_register_a_user(self):

Choose a reason for hiding this comment

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

There was no need of deleting and rewriting the same test. The deleted test was reusing data in the base test file instead of rewriting similar data in the test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i have solved this @collinewait

@@ -20,7 +20,7 @@
# See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ.get("SECRET_KEY", None)
SECRET_KEY = os.environ.get("HOME", None)

Choose a reason for hiding this comment

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

What is the reason behind replacing "SECRET_KEY" with "HOME"?

@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 6, 2018 07:56 Inactive
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 12:10 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 12:40 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 12:45 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 12:53 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 12:58 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 13:05 Failure
@reiosantos
Copy link
Contributor

I'm seeing 11 commits in your PR. could you please squash them together

@huxaiphaer
Copy link
Contributor Author

@reiosantos , am on it

@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from 70b7b98 to 37c7eb8 Compare September 6, 2018 14:20
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:21 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:36 Failure
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from a3e9edd to f47cf24 Compare September 6, 2018 14:40
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:41 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:50 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:55 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 14:58 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 15:05 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 15:06 Failure
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from 9111e3f to 61e6d2c Compare September 6, 2018 15:10
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 15:10 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 16:05 Failure
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 16:10 Failure
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from e1b6af1 to 20e6e89 Compare September 6, 2018 16:13
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 16:13 Failure
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from 20e6e89 to f3e615c Compare September 6, 2018 17:19
@Estaer Estaer had a problem deploying to ah-backend-staging-pr-10 September 6, 2018 17:20 Failure
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from f3e615c to ffaf79f Compare September 6, 2018 17:28
@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 6, 2018 17:28 Inactive
@Estaer Estaer temporarily deployed to ah-backend-staging-pr-10 September 7, 2018 07:32 Inactive
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from 6c16699 to be9fe1d Compare September 7, 2018 07:54
- Implementing all sign up validations tests and functionalities.
[Finishes  #159952001]
@huxaiphaer huxaiphaer force-pushed the ft-signup-validation-errors-159952001 branch from be9fe1d to c4f58e2 Compare September 7, 2018 08:17

self.no_password_login = {
"user": {"email": self.user_email,
"password": None,
Copy link

@inno-asiimwe inno-asiimwe Sep 7, 2018

Choose a reason for hiding this comment

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

Do we really need to pass none here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was still figuring out the way to get the validation error,

@inno-asiimwe inno-asiimwe merged commit 030c961 into develop Sep 7, 2018
@inno-asiimwe inno-asiimwe deleted the ft-signup-validation-errors-159952001 branch September 7, 2018 08:29
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.

None yet

6 participants