コード例 #1
0
    def test_getUserDetails_fail(self):
        response = app.test_client().post(
            '/foresite/getUserDetails',
            data=json.dumps({'user_name': 'test12345'}),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))
        self.assertEqual(data['response'], 'fail')
コード例 #2
0
    def test_getEventList(self):
        query = {}

        response = app.test_client().post(
            'foresite/getEventList',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))

        self.assertEqual(data['response'], 'success')
コード例 #3
0
    def test_editUserDetails(self):
        response = app.test_client().post(
            '/foresite/editUserDetails',
            data=json.dumps({
                'user_name': 'test',
                'first_name': 'testest'
            }),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))
        self.assertEqual(data['response'], 'success')
コード例 #4
0
    def test_login_fail(self):
        response = app.test_client().post(
            '/foresite/login',
            data=json.dumps({
                'user_name': 'test',
                'password': '******'
            }),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))
        self.assertEqual(data['response'], 'fail')
コード例 #5
0
    def test_getEventDetails_fail(self):
        query = {
            'event_id': '12312312'
        }

        response = app.test_client().post(
            'foresite/getEventDetails',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))

        self.assertEqual(data['response'], 'fail')
コード例 #6
0
    def test_signUp_fail(self):
        global detailedID
        query = {
            'user_name': 'test'
        }

        response = app.test_client().post(
            'foresite/signUp',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))

        self.assertEqual(data['response'], 'fail')
コード例 #7
0
    def test_signUp(self):
        global detailedID
        query = {
            'event_id': detailedID,
            'user_name': 'ctarng',
            'amount_bought': 2
        }

        response = app.test_client().post(
            'foresite/signUp',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))

        self.assertEqual(data['response'], 'success')
コード例 #8
0
    def test_createEvent(self):
        global detailedID

        query = {
            'user_name': 'test',
            'title': 'test'
        }

        response = app.test_client().post(
            'foresite/createEvent',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))
        detailedID = data['event_id']
        self.assertEqual(data['response'], 'success')
コード例 #9
0
    def test_createUser(self):
        query = {
            'first_name': 'test',
            'last_name': 'test',
            'email': 'test',
            'phone_number': 'test',
            'user_name': 'test',
            'password': '******'
        }

        response = app.test_client().post(
            '/foresite/createUser',
            data=json.dumps(query),
            content_type='application/json',
        )

        data = json.loads(response.get_data(as_text=True))
        self.assertEqual(data['response'], 'success')