Permalink
Browse files

Merge pull request #2127 from AdrianGaudebert/1013321-fix-supersearch…

…-field-update

Fixes bug 1013321 - Fixed problem with turning supersearch fields values...
  • Loading branch information...
2 parents 266be5b + a6e34bf commit 0afae911e4a0f9aea2dfc08df28038934eecce9a @adngdb adngdb committed Jun 17, 2014
@@ -1042,8 +1042,12 @@ def mocked_get(url, **options):
def mocked_put(url, data, **options):
assert '/supersearch/field/' in url
- assert 'name' in data
- assert 'description' in data
+
+ ok_('name' in data)
+ ok_('description' in data)
+ ok_('is_returned' in data)
+
+ ok_(not data['is_returned'])
return Response(True)
@@ -1056,6 +1060,7 @@ def mocked_put(url, data, **options):
'name': 'something',
'in_database_name': 'something',
'description': 'hello world',
+ 'is_returned': False,
}
)
eq_(response.status_code, 302)
@@ -452,7 +452,7 @@ def supersearch_field_create(request):
return http.HttpResponseBadRequest(field_data)
api = SuperSearchField()
- api.post(**field_data)
+ api.post(field_data)
# Refresh the cache for the fields service.
SuperSearchFields().get(refresh_cache=True)
@@ -469,7 +469,7 @@ def supersearch_field_update(request):
return http.HttpResponseBadRequest(field_data)
api = SuperSearchField()
- api.put(**field_data)
+ api.put(field_data)
# Refresh the cache for the fields service.
SuperSearchFields().get(refresh_cache=True)
@@ -204,13 +204,11 @@ class SuperSearchField(models.SocorroMiddleware):
def get(self, **kwargs):
raise NotImplemented()
- def post(self, **kwargs):
- params = self.kwargs_to_params(kwargs)
- return super(SuperSearchField, self).post(self.URL_PREFIX, params)
+ def post(self, payload):
+ return super(SuperSearchField, self).post(self.URL_PREFIX, payload)
- def put(self, **kwargs):
- params = self.kwargs_to_params(kwargs)
- return super(SuperSearchField, self).put(self.URL_PREFIX, params)
+ def put(self, payload):
+ return super(SuperSearchField, self).put(self.URL_PREFIX, payload)
class Query(models.SocorroMiddleware):

0 comments on commit 0afae91

Please sign in to comment.