Self hosted FLOSS fitness/workout, nutrition and weight tracker
Post JSON in the measurement tests, the API is JSON-only now
Roland Geidercc22620048d3
diff --git a/wger/measurements/tests/test_categories.py b/wger/measurements/tests/test_categories.pyindex 5580f87cb..3815fcef6 100644--- a/wger/measurements/tests/test_categories.py+++ b/wger/measurements/tests/test_categories.py@@ -57,7 +57,7 @@ class CategoryGroupApiTestCase(WgerTestCase):def create_category(self, **data):payload = {'name': 'Systolic', 'unit': 'mmHg', **data}- return self.client.post(self.url, payload)+ return self.client.post(self.url, payload, content_type='application/json')def detail_url(self, pk):return reverse('measurement-category-detail', kwargs={'pk': pk})@@ -196,7 +196,7 @@ class TypedCategoryTestCase(WgerTestCase):def create_category(self, **data):payload = {'name': 'Steps', 'unit': 'count', **data}- return self.client.post(self.url, payload)+ return self.client.post(self.url, payload, content_type='application/json')def detail_url(self, pk):return reverse('measurement-category-detail', kwargs={'pk': pk})diff --git a/wger/measurements/tests/test_measurements.py b/wger/measurements/tests/test_measurements.pyindex d8e9c6bd4..8f7d7826e 100644--- a/wger/measurements/tests/test_measurements.py+++ b/wger/measurements/tests/test_measurements.py@@ -106,6 +106,7 @@ class MeasurementLeafOnlyTestCase(WgerTestCase):'date': '2021-08-12','value': 120,},+ content_type='application/json',)self.assertEqual(response.status_code, 400)@@ -127,6 +128,7 @@ class MeasurementLeafOnlyTestCase(WgerTestCase):'date': '2021-08-12','value': 120,},+ content_type='application/json',)self.assertEqual(response.status_code, 400)diff --git a/wger/weight/tests/test_entry.py b/wger/weight/tests/test_entry.pyindex c76bd7023..26fd77f0d 100644--- a/wger/weight/tests/test_entry.py+++ b/wger/weight/tests/test_entry.py@@ -250,7 +250,12 @@ class WeightEntryTokenAuthTestCase(WgerTestCase):"""date = timezone.now()- response = self.client.post(self.url, {'weight': 81.5, 'date': date}, **self.auth)+ response = self.client.post(+ self.url,+ {'weight': 81.5, 'date': date},+ content_type='application/json',+ **self.auth,+ )self.assertEqual(response.status_code, 201)pk = response.data['id']