Beispiel #1
0
    def delete_one_deleted(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        oid = old_subject["subjectId"]

        subject_bll.delete(oid)
        subject_bll.delete(oid)
Beispiel #2
0
    def update_incorrect_type(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        oid = old_subject["subjectId"]

        subject_bll.update(oid, "Asignatura Muy Nueva", "AMN", 12, 1,
                           "Inexistente", 1, 1)
Beispiel #3
0
    def update_incorrect_course(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        oid = old_subject["subjectId"]

        subject_bll.update(oid, "Asignatura Muy Nueva", "AMN", 12, -4,
                           "Obligatoria", 1, 1)
Beispiel #4
0
    def update_same_name(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        other_subject = subject_list[1]
        oid = old_subject["subjectId"]

        subject_bll.update(oid, other_subject["name"], "AMN", 12, 1,
                           "Obligatoria", 1, 1)
Beispiel #5
0
    def update_success(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        oid = old_subject["subjectId"]

        subject_bll.update(oid, "Asignatura Muy Nueva", "AMN", 12, 1,
                           "Obligatoria", 1, 1)

        subject = subject_dal.get_by_name(old_subject["name"])
        if subject is not None:
            raise BLLException(
                "The subject has the same name as before the change")

        subject = subject_dal.get_by_name("Asignatura Muy Nueva")
        if subject is None:
            raise BLLException("The subject has not got the new name")
Beispiel #6
0
    def update_same_acronym(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        other_subject = subject_list[1]
        oid = old_subject["subjectId"]

        subject_bll.update(
            oid,
            "Asignatura Muy Nueva",
            other_subject["acronym"],
            12,
            1,
            "Obligatoria",
            1,
            1,
        )
Beispiel #7
0
    def update_incorrect_name(self):
        subject_list = subject_dal.get_all()
        old_subject = subject_list[0]
        oid = old_subject["subjectId"]

        subject_bll.update(oid, " ", "AMN", 12, 1, "Obligatoria", 1, 1)
Beispiel #8
0
def get_all() -> Tuple[Response, int]:
    """Returns all subjects in the system"""
    subjects: tuple = subject_dal.get_all()
    return jsonify(subjects), 200