def test_casting_vote(self):
connection = ConnectionFactory()
url = reverse('add-vote', kwargs={'connection_id': connection.id})
response = self.client.post(url)
self.assertEqual(response.status_code, 201)
self.assertEqual(connection.votes.count(), 1)
评论列表
文章目录