Skip to content

Commit

Permalink
(#189) Modificando nota maxima para 5
Browse files Browse the repository at this point in the history
  • Loading branch information
oEduardoAfonso committed May 4, 2021
1 parent e444a9a commit 639bd64
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions app/schemas/post_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class Meta:
id_professor = fields.Integer(required=True, validate=validate.Range(min=0))
discipline_code = fields.String(required=True, validate=validate.Length(max=80), load_only=True)
content = fields.String(required=True, validate=validate.Length(min=1, max=480))
didactic = fields.Float(required=True, validate=validate.Range(min=0, max=10))
metod = fields.Float(required=True, validate=validate.Range(min=0, max=10))
avaliations = fields.Float(required=True, validate=validate.Range(min=0, max=10))
disponibility = fields.Float(required=True, validate=validate.Range(min=0, max=10))
didactic = fields.Float(required=True, validate=validate.Range(min=0, max=5))
metod = fields.Float(required=True, validate=validate.Range(min=0, max=5))
avaliations = fields.Float(required=True, validate=validate.Range(min=0, max=5))
disponibility = fields.Float(required=True, validate=validate.Range(min=0, max=5))
is_anonymous = fields.Boolean(required=True)
post_date = fields.Date()

Expand Down
10 changes: 5 additions & 5 deletions tests/tests_post.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def valid_post(self):
"id_professor": self.professor['id_professor'],
"reg_student": self.student['reg_student'],
"discipline_code": self.discipline['discipline_code'],
"content": "Professor nota dez",
"content": "Professor nota cinco",
"didactic": "5",
"metod": "5",
"avaliations": "5",
Expand Down Expand Up @@ -96,10 +96,10 @@ def test_api_must_validate_attributes_min(self):
def test_api_must_validate_attributes_max(self):
post = valid_post(self)
post['content'] = "a"*481
post['didactic'] = 11
post['metod'] = 11
post['avaliations'] = 11
post['disponibility'] = 11
post['didactic'] = 6
post['metod'] = 6
post['avaliations'] = 6
post['disponibility'] = 6
response = register_post(self, post=post)

self.assertEqual(response.status_code, 400)
Expand Down

0 comments on commit 639bd64

Please sign in to comment.