'The view should return JSON.'

def test_json_response(self):

    response = self._auto_auth()
    response_data = json.loads(response.content)
    for key in ['created_status', 'username', 'email', 'password', 'user_id', 'anonymous_id']:
        self.assertIn(key, response_data)
    user = User.objects.get(username=response_data['username'])
    self.assertDictContainsSubset({'created_status': 'Logged    in', 'anonymous_id': anonymous_id_for_user(user, None)}, response_data)
