Skip to content

Commit

Permalink
test: fga-eps-mds/2020.2-Lend.it#138 Route and name changed in the te…
Browse files Browse the repository at this point in the history
…st get requests filtered by category

Co-authored-by: Thiago Mesquita <thiago099carvalho@gmail.com>
Co-authored-by: Mateus Maia <mateusmaiamaia@hotmail.com>
  • Loading branch information
3 people committed Apr 24, 2021
1 parent d2f1ce8 commit 1563bfa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions project/tests/test_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
FAKE_DESCRIPTION = (
"Queria um Uno emprestado para jogar com meus amigos neste fim de semana!"
)
FAKE_ENDDATE = "2020-09-30 00:00:00.000"
FAKE_ENDDATE = "2021-09-30 00:00:00.000"
FAKE_STARTDATE = "2020-09-12 00:00:00.000"
FAKE_REQUESTER = "matheus@email.com"
REQUEST_BASE_URL = "/requests"
Expand Down Expand Up @@ -151,8 +151,8 @@ def test_get_all_requests_lender(self):

self.assertEqual(len(data["data"]["requests"]), 1)

def test_get_filtered_requests(self):
add_category("Eletrodomésticos")
def test_get_requests_filtered_by_category(self):
add_category("Jogos")
add_request(
"Jogo da vida",
FAKE_STARTDATE,
Expand All @@ -171,7 +171,9 @@ def test_get_filtered_requests(self):
)

with self.client:
response = self.client.get(f"{REQUEST_BASE_URL}/1")
response = self.client.get(
f"{REQUEST_BASE_URL}/available/1?usermail={FAKE_EMAIL}"
)
data = json.loads(response.data.decode())

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

0 comments on commit 1563bfa

Please # to comment.