def getData(request): qs = DataPoint.query( username = request.GET.get('username', None), gameNum = request.GET.get('gameNum', None), cueDetail = request.GET.get('cueDetail', None), level = request.GET.get('level', None), moveCost = request.GET.get('moveCost', None), endGame = request.GET.get('endGame', None)) response = {'data': [el.toDict() for el in qs]} return HttpResponse(json.dumps(response), content_type="application/json")
def test_add_data_point(self): Node(node_id='TEST').put() data_point_json = { 'node_id': 'TEST', 'temperature': 50, 'humidity': 40, 'pressure': 34, 'light': 14, 'saturation': 12, } response = self.app.post_json('/datapoint/', data_point_json) self.assertEqual(201, response.status_code) self.assertEqual( {'status': 'success'}, json.loads(response.body)) self.assertEqual(1, DataPoint.query().count())