IT-Academy-BCN / ita-landing-backend

5 stars 1 forks source link

Feature/login #55

Closed GabrielaMaureira closed 1 year ago

GabrielaMaureira commented 1 year ago

Added 3 more methods:

  1. test_a_user_cannot_be_logged_in_with_missing_fields: A login request is made without providing any data, and the response is expected to have a status code of 422, indicating that required fields are missing.
  2. test_a_user_cannot_be_logged_in_with_wrong_password: A user is created in the database with a valid password and a login request is made with an incorrect password. The response is expected to have a 401 status code and a message indicating "Invalid credentials". And is verified that the user is not authenticated.
  3. test_a_user_cannot_be_logged_in_with_wrong_dni: The same as the previous method but this time the request is made with a wrong 'dni'
CloudSalander commented 1 year ago

Enough by now. Thanks!

CloudSalander commented 1 year ago

I have to say,but, that I don't recommend to put more than 1 assert in a test.