Beispiel #1
0
    def test_json_with_resource(self, mock_jsonify, mock_get_store):
        resource = Patient(id="test")
        mock_get_store.return_value.normalize_resource.return_value = resource
        r = BaseResource(resource=resource)

        r.json()
        mock_jsonify.assert_called_once_with(resource.dict())
Beispiel #2
0
    def test_json_with_id(self, mock_jsonify, mock_get_store):
        r = BaseResource(id="test")

        r.json()
        mock_jsonify.assert_called_once_with({"id": "test"})