Ejemplo n.º 1
0
    def test_invalid_credentials(self):
        """
        Test that a user can't login with invalid credentials

        """

        request = self.factory.post(reverse('auth'), {
            'username': '******',
            'password': '******'
        })
        request.user = self.user
        apply_middleware(request)
        view = LoginView.as_view()
        response = view(request)

        self.assertTrue(response.status_code == 401)
Ejemplo n.º 2
0
    def test_login_w_email(self):
        """
        Test that a user can login with their email address and is redirected to the home page

        """

        request = self.factory.post(reverse('auth'), {
            'username': '******',
            'password': '******'
        })
        request.user = self.user
        apply_middleware(request)
        view = LoginView.as_view()
        response = view(request)

        self.assertTrue(response.status_code == 302)
        self.assertTrue(response.get('location') == reverse('home'))
Ejemplo n.º 3
0
    def test_login_w_email(self):
        """
        Test that a user can login with their email address and is redirected to the home page

        """

        request = self.factory.post(reverse("auth"), {
            "username": "******",
            "password": "******"
        })
        request.user = self.user
        apply_middleware(request)
        view = LoginView.as_view()
        response = view(request)

        self.assertTrue(response.status_code == 302)
        self.assertTrue(response.get("location") == reverse("home"))
Ejemplo n.º 4
0
    def test_logout(self):
        """
        Test that a user can logout

        """

        view = LoginView.as_view()

        request = self.factory.post(reverse('auth'), {
            'username': '******',
            'password': '******'
        })
        request.user = self.user
        apply_middleware(request)
        response = view(request)

        request = self.factory.get(reverse('auth'), {'logout': 'true'})
        request.user = self.user
        apply_middleware(request)
        response = view(request)

        self.assertTrue(response.status_code == 302)
        self.assertTrue(response.get('location') == reverse('auth'))
Ejemplo n.º 5
0
    def test_logout(self):
        """
        Test that a user can logout

        """

        view = LoginView.as_view()

        request = self.factory.post(reverse("auth"), {
            "username": "******",
            "password": "******"
        })
        request.user = self.user
        apply_middleware(request)
        response = view(request)

        request = self.factory.get(reverse("auth"), {"logout": "true"})
        request.user = self.user
        apply_middleware(request)
        response = view(request)

        self.assertTrue(response.status_code == 302)
        self.assertTrue(response.get("location") == reverse("auth"))
Ejemplo n.º 6
0
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

uuid_regex = settings.UUID_REGEX

urlpatterns = [
    url(r'^$', main.index, name='root'),
    url(r'^index.htm', main.index, name='home'),
    url(r'^auth/password$', ChangePasswordView.as_view(), name='change_password'),
    url(r'^auth/signup$', SignupView.as_view(), name='signup'),
    url(r'^auth/confirm_signup$', ConfirmSignupView.as_view(), name='confirm_signup'),
    url(r'^auth/get_token$', GetTokenView.as_view(), name='get_token'),
    url(r'^auth/get_client_id$', GetClientIdView.as_view(), name='get_client_id'),
    url(r'^auth/user_profile$', UserProfileView.as_view(), name='user_profile'),
    url(r'^auth/', LoginView.as_view(), name='auth'),
    url(r'^rdm/(?P<conceptid>%s|())$' % uuid_regex , RDMView.as_view(), name='rdm'),
    url(r'^admin/reindex/resources$', ReIndexResources.as_view(), name="reindex"),
    url(r'^concepts/(?P<conceptid>%s)/manage_parents/$' % uuid_regex, concept.manage_parents, name="concept_manage_parents"),
    url(r'^concepts/(?P<conceptid>%s)/confirm_delete/$' % uuid_regex, concept.confirm_delete, name="confirm_delete"),
    url(r'^concepts/(?P<conceptid>%s)/make_collection/$' % uuid_regex, concept.make_collection, name="make_collection"),
    url(r'^concepts/(?P<conceptid>%s|())$' % uuid_regex , concept.concept, name="concept"),
    url(r'^concepts/tree/(?P<mode>.*)', concept.concept_tree, name="concept_tree"),
    url(r'^concepts/search$', concept.search, name="concept_search"),
    url(r'^concepts/(?P<conceptid>%s)/from_sparql_endpoint$' % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint"),
    url(r'^concepts/search_sparql_endpoint$', concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"),
    url(r'^concepts/dropdown', concept.dropdown, name="dropdown"),
    url(r'^concepts/paged_dropdown', concept.paged_dropdown, name="paged_dropdown"),
    url(r'^concepts/export/(?P<conceptid>%s)$' % uuid_regex , concept.export, name="export_concept"),
    url(r'^concepts/export/collections', concept.export_collections, name="export_concept_collections"),
    url(r'^concepts/collections', concept.get_concept_collections, name="get_concept_collections"),
Ejemplo n.º 7
0
admin.autodiscover()

uuid_regex = settings.UUID_REGEX


urlpatterns = [
    url(r"^$", main.index, name="root"),
    url(r"^index.htm", main.index, name="home"),
    url(r"^auth/password$", ChangePasswordView.as_view(), name="change_password"),
    url(r"^auth/signup$", SignupView.as_view(), name="signup"),
    url(r"^auth/confirm_signup$", ConfirmSignupView.as_view(), name="confirm_signup"),
    url(r"^auth/get_client_id$", GetClientIdView.as_view(), name="get_client_id"),
    url(r"^auth/user_profile$", UserProfileView.as_view(), name="user_profile"),
    url(r"^auth/server_settings$", ServerSettingView.as_view(), name="server_settings"),
    url(r"^auth/get_dev_token$", Token.as_view(), name="get_dev_token"),
    url(r"^auth/", LoginView.as_view(), name="auth"),
    url(r"^rdm/(?P<conceptid>%s|())$" % uuid_regex, RDMView.as_view(), name="rdm"),
    url(r"^admin/reindex/resources$", ReIndexResources.as_view(), name="reindex"),
    url(r"^files/(?P<fileid>%s)$" % uuid_regex, FileView.as_view(), name="file_access"),
    url(r"^concepts/(?P<conceptid>%s)/manage_parents/$" % uuid_regex, concept.manage_parents, name="concept_manage_parents"),
    url(r"^concepts/(?P<conceptid>%s)/confirm_delete/$" % uuid_regex, concept.confirm_delete, name="confirm_delete"),
    url(r"^concepts/(?P<conceptid>%s)/make_collection/$" % uuid_regex, concept.make_collection, name="make_collection"),
    url(r"^concepts/(?P<conceptid>%s|())$" % uuid_regex, concept.concept, name="concept"),
    url(r"^concepts/tree/(?P<mode>.*)", concept.concept_tree, name="concept_tree"),
    url(r"^concepts/search$", concept.search, name="concept_search"),
    url(
        r"^concepts/(?P<conceptid>%s)/from_sparql_endpoint$" % uuid_regex,
        concept.add_concepts_from_sparql_endpoint,
        name="from_sparql_endpoint",
    ),
    url(r"^concepts/search_sparql_endpoint$", concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"),
Ejemplo n.º 8
0
from arches.app.utils.forms import ArchesPasswordResetForm
from arches.app.utils.forms import ArchesSetPasswordForm
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

uuid_regex = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}'

urlpatterns = [
    url(r'^$', main.index, name='root'),
    url(r'^index.htm', main.index, name='home'),
    url(r'^auth/password$', ChangePasswordView.as_view(), name='change_password'),
    url(r'^auth/signup$', SignupView.as_view(), name='signup'),
    url(r'^auth/confirm_signup$', ConfirmSignupView.as_view(), name='confirm_signup'),
    url(r'^auth/get_token$', GetTokenView.as_view(), name='get_token'),
    url(r'^auth/', LoginView.as_view(), name='auth'),
    url(r'^rdm/(?P<conceptid>%s|())$' % uuid_regex , RDMView.as_view(), name='rdm'),
    url(r'^admin/reindex/resources$', ReIndexResources.as_view(), name="reindex"),
    url(r'^concepts/(?P<conceptid>%s)/manage_parents/$' % uuid_regex, concept.manage_parents, name="concept_manage_parents"),
    url(r'^concepts/(?P<conceptid>%s)/confirm_delete/$' % uuid_regex, concept.confirm_delete, name="confirm_delete"),
    url(r'^concepts/(?P<conceptid>%s)/make_collection/$' % uuid_regex, concept.make_collection, name="make_collection"),
    url(r'^concepts/(?P<conceptid>%s|())$' % uuid_regex , concept.concept, name="concept"),
    url(r'^concepts/tree/(?P<mode>.*)', concept.concept_tree, name="concept_tree"),
    url(r'^concepts/search$', concept.search, name="concept_search"),
    url(r'^concepts/(?P<conceptid>%s)/from_sparql_endpoint$' % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint"),
    url(r'^concepts/search_sparql_endpoint$', concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"),
    url(r'^concepts/dropdown', concept.dropdown, name="dropdown"),
    url(r'^concepts/paged_dropdown', concept.paged_dropdown, name="paged_dropdown"),
    url(r'^concepts/export/(?P<conceptid>%s)$' % uuid_regex , concept.export, name="export_concept"),
    url(r'^concepts/export/collections', concept.export_collections, name="export_concept_collections"),
    url(r'^concepts/get_pref_label', concept.get_pref_label, name="get_pref_label"),
Ejemplo n.º 9
0
'''
ARCHES - a program developed to inventory and manage immovable cultural heritage.
Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
'''
from django.conf.urls import include, url
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from arches.app.views import concept, main, map, search, graph, tileserver
from arches.app.views.admin import ReIndexResources
from arches.app.views.graph import GraphManagerView, GraphSettingsView, GraphDataView, DatatypeTemplateView, CardManagerView, CardView, FormManagerView, FormView, ReportManagerView, ReportEditorView, FunctionManagerView, PermissionManagerView, PermissionDataView
from arches.app.views.resource import ResourceEditorView, ResourceListView, ResourceData, ResourceCards, ResourceReportView, RelatedResourcesView, ResourceDescriptors, ResourceEditLogView
from arches.app.views.concept import RDMView
from arches.app.views.user import UserManagerView
from arches.app.views.tile import TileData
from arches.app.views.map import MapLayerManagerView
from arches.app.views.mobile_survey import MobileSurveyManagerView, MobileSurveyResources
from arches.app.views.auth import LoginView, SignupView, ConfirmSignupView, ChangePasswordView, GetTokenView
from arches.app.models.system_settings import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()