Esempio n. 1
0
    def setUp(self):
        AccountModel.objects.create(username="******", password="******", name="supervisor", address="streetplace100",
                                    email="*****@*****.**", phonenumber="1235678", accountFlag=0)
        AccountModel.objects.create(username="******", password="******", name="admin", address="streetplace1",
                                    email="*****@*****.**", phonenumber="1235678", accountFlag=1)
        AccountModel.objects.create(username="******", password="******", name="instructor", address="streetplace2",
                                    email="*****@*****.**", phonenumber="1235678", accountFlag=2)

        AccountModel.objects.create(username="******", password="******", name="ta", address="streetplace3",
                                    email="*****@*****.**", phonenumber="1235678", accountFlag=3)

        CourseModel.objects.create(number="100", name="Engineering")

        LabModel.objects.create(name="Lab101")
        course = CourseModel.objects.get(number="100")
        lab = LabModel.objects.get(name="Lab101")
        lab.course = course

        logout(["logout"])
        login(["login","sup123", "pass321"])
Esempio n. 2
0
 def testAssignTaLab6(self):  # Correct Use
     logout(["logout"])
     login(["login", "in123", "pass321"])
     self.assertEqual(assignTALab(["assigntalab", "ta123", "Lab101"]), "TA Added")
Esempio n. 3
0
 def test_logoff1(self):  # User logged in
     self.assertEqual(login(["login", "user123", "pass321"]),
                      "Login Success")
     self.assertEqual(logout(["logout"]), "Logout Success")
Esempio n. 4
0
 def test_loginLogoff(self):  # (Will fail until memory is complete)
     self.assertEqual(login(["login", "user123", "pass321"]),
                      "Login Success")
     self.assertEqual(logout(["logout"]), "Logout Success")
Esempio n. 5
0
 def test_login8(self):  # both, user logged in. Should return error
     self.assertEqual(login(["login", "user123", "pass321"]),
                      "Login Success")
     self.assertEqual(login(["login", "user123", "pass321"]),
                      "Another User is logged in")
Esempio n. 6
0
 def test_login9(self):
     self.assertEqual(login(["login", "too", "many", "arguments"]), "Error")
Esempio n. 7
0
 def test_login7(
         self):  # only password, user logged in. Should return error
     self.assertEqual(login(["login", "password"]), "Error")
Esempio n. 8
0
 def test_login6(
         self):  # only username, user logged in. Should return error
     self.assertEqual(login(["login", "user123"]), "Error")
Esempio n. 9
0
 def test_login5(
     self
 ):  # No username and password entered, user logged in. Should return error
     self.assertEqual(login(["login"]), "Error")
Esempio n. 10
0
 def test_login4(
     self
 ):  # both, no user logged in. Should pass(Will fail until memory is complete)
     self.assertEqual(login(["login", "user123", "pass321"]),
                      "Login Success")
Esempio n. 11
0
 def test_wrong_pass(self):
     self.assertEqual(login(["login", "user123", "abcdefg"]),
                      "Wrong Password")