@@ -0,0 +1,1572 @@
+# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2015 CoNWeT Lab., Universidad Polit%C3%A9cnica de Madrid%0A%0A# This file is part of CKAN Data Requests Extension.%0A%0A# CKAN Data Requests Extension is free software: you can redistribute it and/or%0A# modify it under the terms of the GNU Affero General Public License as published by%0A# the Free Software Foundation, either version 3 of the License, or%0A# (at your option) any later version.%0A%0A# CKAN Data Requests Extension is distributed in the hope that it will be useful,%0A# but WITHOUT ANY WARRANTY; without even the implied warranty of%0A# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A# GNU Affero General Public License for more details.%0A%0A# You should have received a copy of the GNU Affero General Public License%0A# along with CKAN Data Requests Extension. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0A%0Aimport ckanext.datarequests.auth as auth%0Aimport unittest%0A%0Afrom mock import MagicMock%0Afrom nose_parameterized import parameterized%0A%0A# Needed for the test%0Acontext = %7B%0A    'user': 'example_usr',%0A    'auth_user_obj': MagicMock(),%0A    'model': MagicMock(),%0A    'session': MagicMock()%0A%7D%0A%0Arequest_data = %7B%0A    'title': 'title',%0A    'description': 'description',%0A    'organization': 'organization'%0A%7D%0A%0A%0Aclass AuthTest(unittest.TestCase):%0A%0A    @parameterized.expand(%5B%0A        (None,    None),%0A        (context, None),%0A        (None,    request_data),%0A        (context, request_data)%0A    %5D)%0A    def test_datarequest_create_is_true(self, context, request_data):%0A        self.assertTrue(auth.datarequest_create(context, request_data))%0A

Test for auth