Пример #1
0
    def test_visit_history_empty(self):
        filterz = {}

        connection = get_conn()
        with connection.cursor() as cursor:

            user_service = UserService()

            user_service.VisitHistory('calcwizard', filterz)

            cursor.execute(
                "select * from UserVisitTheater where username='******'")
            data = cursor.fetchall()
            connection.commit()

        connection.close()

        assert len(data) == 3
Пример #2
0
    def test_visit_history(self):
        filterz = {
            'i_comName': '4400 Theater Company',
            'i_minVisitDate': datetime.date(2005, 11, 25),
            'i_maxVisitDate': datetime.date(2012, 11, 30)
        }

        connection = get_conn()
        with connection.cursor() as cursor:

            user_service = UserService()

            user_service.VisitHistory('imready', filterz)

            cursor.execute(
                "select * from UserVisitTheater where username='******'")
            data = cursor.fetchall()
            connection.commit()

        connection.close()

        assert len(data) == 1