Exemplo n.º 1
0
 def test_add_one_in_stock(self):
     """Add an in-stock Cultivar to worksheet."""
     wb = Workbook()
     ws = wb.active
     cvws = CultivarsWorksheet(ws)
     cvws.setup()
     cv = Cultivar(name='Foxy')
     cv.common_name = CommonName(name='Foxglove')
     cv.common_name.index = Index(name='Perennial')
     cv.in_stock = True
     cvws.add_one(cv)
     assert cvws.cell(2, cvws.cols['In Stock']).value == 'True'
     cv2 = Cultivar(name='Soulmate')
     cv2.common_name = CommonName(name='Butterfly Weed')
     cv2.common_name.index = Index(name='Perennial')
     cv2.in_stock = False
     cvws.add_one(cv2)
     assert cvws.cell(3, cvws.cols['In Stock']).value == 'False'