

def test_pending_suggestions_count_view(self):
    c = Client()
    NAME = 'The chosen one'
    suggestion = Suggestion.objects.create_suggestion(suggested_by=self.regular_user, actions=[{
        'action': consts.CREATE,
        'fields': {
            'name': NAME,
            'current_party': self.party,
        },
        'subject': Member,
    }])
    response = c.get('/suggestions/pending_count/', {
        'for': 'mks.Member',
    })
    self.assertEqual(response['Content-Type'], 'application/json')
    data = json.loads(response.content)
    self.assertEqual(data.items()[0][1], 1)
    m = suggestion.auto_apply(self.editor)
    response = c.get('/suggestions/pending_count/', {
        'for': 'mks.Member',
    })
    self.assertEqual(response['Content-Type'], 'application/json')
    data = json.loads(response.content)
    self.assertFalse(response)
    m.delete()
    Suggestion.objects.all().delete()

dataset/ETHPy150Open ofri/Open-Knesset/suggestions/tests.py SuggestionsTests.test_pending_suggestions_count_view/VarMisuse@190/271 `data`->`response`