Answered step by step
Verified Expert Solution
Question
1 Approved Answer
import unittest import tkinter as tk from tkinter import ttk from craft _ workshop import WorkshopApp, Student, Course class TestWorkshopApp ( unittest . TestCase )
import unittest
import tkinter as tk
from tkinter import ttk
from craftworkshop import WorkshopApp, Student, Course
class TestWorkshopAppunittestTestCase:
def setUpself:
self.root tkTk
self.app WorkshopAppselfroot
def showstudentdetailsself student:
detailswindow tkToplevelselfroot, name"detailswindow"
detailswindow.titleStudent Details"
labels Name "Home Phone", "Mobile Phone", "Address", "Email"
entries
for i label in enumeratelabels:
ttkLabeldetailswindow, textflabel:gridrowi column padx pady
entry ttkEntrydetailswindow
entry.insert getattrstudent label.lowerreplace
entry.gridrowi column padx pady
entrieslabel entry
tree ttkTreeviewdetailswindow, columnsCourse ID 'Payment' show'headings'
tree.headingCourse ID text'Course ID
tree.headingPayment text'Payment'
tree.gridrowlenlabels column columnspan padx pady sticky'nsew'
for courseid payment in student.payments.items:
tree.insert 'end', valuescourseid f$payment
savebtn ttkButtondetailswindow, text"Save", commandlambda: self.savestudentchangesstudent entries
savebtngridrowlenlabels column padx pady
if namemain:
unittest.main
When I run this test, it says tests. How can I fix?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started