def post(): if request.method == 'POST': bills = Bill.add_bill(request.form["number"], request.form["sklad"], request.form["detail"], request.form["date_poluch"], request.form["price"], request.form["remontnik"]) return render_template('Bill/post_bill.html', title="Добавление накладных", menu=menu)
def put(): if request.method == 'POST': bills = Bill.update_bill(request.form["number"], request.form["sklad"], request.form["detail"], request.form["date_poluch"], request.form["price"], request.form["remontnik"]) return render_template('Bill/put_bill.html', title="Обновление и информации о накладных", menu=menu)
def test_c_update_bill(self): Bill.update_bill(1, sklad=1) n = self.take_data() self.assertEqual(n[0][1], 1) Bill.update_bill(1, detail=8) n = self.take_data() self.assertEqual(n[0][2], 8) Bill.update_bill(1, date_poluch="2018-06-06") n = self.take_data() self.assertEqual(n[0][3], datetime.date(2018, 6, 6)) Bill.update_bill(1, price=17000) n = self.take_data() self.assertEqual(n[0][4], 17000) Bill.update_bill(1, remontnik=1) n = self.take_data() self.assertEqual(n[0][5], 1)
def test_d_delete_bill(self): c = self.check_count() Bill.delete_bill(1) self.assertGreater(c, self.check_count())
def test_b_add_bill(self): c = self.check_count() Bill.add_bill(1, 2, 9, "2019-08-05", 1999, 2) self.assertGreater(self.check_count(), c)
def test_a_get_bill(self): self.assertEqual(3, len(Bill.get_bill()))
def delete(): if request.method == 'POST': bills = Bill.delete_bill(int(request.form["number"])) return render_template('Bill/delete_bill.html', title="Удаление накладных", menu=menu)
def get(): result = Bill.get_bill() return render_template('Bill/Bill.html', title="Просмотр накладных", menu=menu, bills=result)