'Test that the data.json representation behaves correctly'

def test_data_json(self):

    response = self.client.get(reverse('data_json')).content
    data_json = json.loads(response)
    len1 = len(ResourceBase.objects.all())
    len2 = len(data_json)
    self.assertEquals(len1, len2, 'Expected    equality    of    json    and    repository    lengths')
    record_keys = ['accessLevel', 'contactPoint', 'description', 'distribution', 'identifier', 'keyword', 'mbox', 'modified', 'publisher', 'title']
    for record in data_json:
        self.assertEquals(record_keys, record.keys(), 'Expected    specific    list    of    fields    to    output')
