Ejemplo n.º 1
0
    def test_next_quarter(self):
        with self.settings(RESTCLIENTS_SWS_DAO_CLASS=FDAO_SWS):
            now_request = RequestFactory().get("/")
            now_request.session = {}

            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, "summer")

            now_request.session["myuw_override_date"] = "2013-04-01"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, "summer")

            now_request.session["myuw_override_date"] = "2013-03-31"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, "summer")

            now_request.session["myuw_override_date"] = "2013-06-24"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, "autumn")

            now_request.session["myuw_override_date"] = "2013-06-23"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, "summer")
Ejemplo n.º 2
0
def get_next_quarter_schedule(request):
    """
    Return the actively enrolled sections in the next quarter
    """
    # MUWM-1981
    if get_next_quarter(request) == get_current_quarter(request):
        return None
    return get_schedule_by_term(get_next_quarter(request))
Ejemplo n.º 3
0
def get_next_quarter_schedule(request):
    """
    Return the actively enrolled sections in the next quarter
    """
    # MUWM-1981
    if get_next_quarter(request) == get_current_quarter(request):
        return None
    return get_schedule_by_term(request, get_next_quarter(request))
Ejemplo n.º 4
0
    def test_next_quarter(self):
        with self.settings(RESTCLIENTS_SWS_DAO_CLASS=FDAO_SWS):
            now_request = RequestFactory().get("/")
            now_request.session = {}

            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, 'summer')

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-04-01"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, 'summer')

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-03-31"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, 'summer')

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-06-24"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, 'autumn')

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-06-23"
            quarter = get_next_quarter(now_request)
            self.assertEquals(quarter.year, 2013)
            self.assertEquals(quarter.quarter, 'summer')
Ejemplo n.º 5
0
def get_reg_data(now, request):
    """
    now is the second after mid-night
    """
    term_reg_data = {
        "after_start": False,
        "after_summer1_start": False,
        "after_summerA_start": False,
    }
    next_term = get_next_quarter(request)
    get_term_reg_data(now, next_term, term_reg_data)
    # We need to show this term's registration stuff, because
    # the period 2 stretches past the grade submission deadline
    current_term = get_current_quarter(request)
    get_term_reg_data(now, current_term, term_reg_data)
    # We also need to be able to show the term after next, in spring quarter
    term_after_next = get_term_after(next_term)
    get_term_reg_data(now, term_after_next, term_reg_data)
    return term_reg_data
Ejemplo n.º 6
0
def get_reg_data(now, request):
    """
    now is the second after mid-night
    """
    term_reg_data = {
        "after_start": False,
        "after_summer1_start": False,
        "after_summerA_start": False,
        "myplan_peak_load": False
    }
    next_term = get_next_quarter(request)
    get_term_reg_data(now, next_term, term_reg_data)
    # We need to show this term's registration stuff, because
    # the period 2 stretches past the grade submission deadline
    current_term = get_current_quarter(request)
    get_term_reg_data(now, current_term, term_reg_data)
    # We also need to be able to show the term after next, in spring quarter
    term_after_next = get_term_after(next_term)
    get_term_reg_data(now, term_after_next, term_reg_data)
    return term_reg_data
Ejemplo n.º 7
0
    def test_winter_quarter_schedule(self):
        with self.settings(RESTCLIENTS_SWS_DAO_CLASS=FDAO_SWS,
                           RESTCLIENTS_PWS_DAO_CLASS=FDAO_PWS):

            regid = "9136CCB8F66711D5BE060004AC494FFE"

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-11-30"
            cur_term = get_current_quarter(now_request)
            self.assertEqual(cur_term.year, 2013)
            self.assertEqual(cur_term.quarter, "autumn")

            next_term = get_next_quarter(now_request)
            self.assertEqual(next_term.year, 2014)
            self.assertEqual(next_term.quarter, "winter")
            self.assertFalse(cur_term == next_term)

            winter2014_sche = _get_schedule(regid, next_term)
            self.assertIsNotNone(winter2014_sche)
            self.assertEqual(len(winter2014_sche.sections), 5)
Ejemplo n.º 8
0
    def test_winter_quarter_schedule(self):
        with self.settings(RESTCLIENTS_SWS_DAO_CLASS=FDAO_SWS,
                           RESTCLIENTS_PWS_DAO_CLASS=FDAO_PWS):

            regid = "9136CCB8F66711D5BE060004AC494FFE"

            now_request = RequestFactory().get("/")
            now_request.session = {}
            now_request.session["myuw_override_date"] = "2013-11-30"
            cur_term = get_current_quarter(now_request)
            self.assertEqual(cur_term.year, 2013)
            self.assertEqual(cur_term.quarter, "autumn")

            next_term = get_next_quarter(now_request)
            self.assertEqual(next_term.year, 2014)
            self.assertEqual(next_term.quarter, "winter")
            self.assertFalse(cur_term == next_term)

            winter2014_sche = _get_schedule(regid, next_term)
            self.assertIsNotNone(winter2014_sche)
            self.assertEqual(len(winter2014_sche.sections), 5)