diff --git a/README.md b/README.md index 88ea40a3..e1639a0f 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,7 @@ - Front-end repository : https://github.com/Volontaria/Website-Volontaria - Documentation for the project : http://volontaria.readthedocs.io -## Issue manager +## Interested -Issues are handled in a [Redmine instance](https://genielibre.com/projects/volontaria). -Feel free to create an account there to begin contributing! - -## Important - -API-Volontaria is not yet ready for testing and is still under development! It will not work as expected! If you'd like to join the public beta test group please contact us. +If you'd like to install Volontaria for your organization feel free to contact us to sync your effort with our +development team and get important tips on deployment and configuration. diff --git a/requirements.txt b/requirements.txt index bf3e7852..813df770 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,14 +1,17 @@ -Django==2.2.3 +Django==2.2.14 django-filter==2.2.0 -djangorestframework==3.10.2 -Markdown==2.6.11 +djangorestframework==3.10.3 +Markdown==3.2.1 drfdocs==0.0.11 django-cors-headers==3.0.2 Faker==0.8.17 factory-boy==2.10.0 -django-import-export==1.2.0 +django-import-export==2.0.1 django-anymail==6.1 coreapi==2.3.3 django-orderable==6.0.1 django-ckeditor==5.7.1 django-reversion==3.0.3 +xlrd==1.2.0 +xlwt==1.3.0 +openpyxl==3.0.3 \ No newline at end of file diff --git a/source/__init__.py b/source/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/source/apiVolontaria/__init__.py b/source/apiVolontaria/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/source/apiVolontaria/apiVolontaria/permissions.py b/source/apiVolontaria/apiVolontaria/permissions.py new file mode 100644 index 00000000..629e1d71 --- /dev/null +++ b/source/apiVolontaria/apiVolontaria/permissions.py @@ -0,0 +1,15 @@ +from rest_framework import permissions + + +class IsAdminOrReadOnly(permissions.BasePermission): + """ + Custom permission to only allow admins to modify objects. + """ + + def has_permission(self, request, view): + # Read permissions are allowed to any request, + # so we'll always allow GET, HEAD or OPTIONS requests. + if request.method in permissions.SAFE_METHODS: + return True + + return request.user.is_staff \ No newline at end of file diff --git a/source/apiVolontaria/apiVolontaria/settings.py b/source/apiVolontaria/apiVolontaria/settings.py index c9d4d286..257917df 100644 --- a/source/apiVolontaria/apiVolontaria/settings.py +++ b/source/apiVolontaria/apiVolontaria/settings.py @@ -42,16 +42,16 @@ 'rest_framework_docs', 'rest_framework.authtoken', 'corsheaders', + 'apiVolontaria', + 'volunteer', + 'location', + 'pages', + 'ckeditor_api', 'import_export', 'anymail', 'orderable', 'ckeditor', 'reversion', - - 'apiVolontaria', - 'volunteer', - 'location', - 'pages', ] MIDDLEWARE = [ diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_model_ActionToken.py b/source/apiVolontaria/apiVolontaria/tests/tests_model_ActionToken.py index e1827acc..f3a248a0 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_model_ActionToken.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_model_ActionToken.py @@ -1,8 +1,8 @@ from rest_framework.test import APITestCase from django.utils import timezone -from ..models import ActionToken -from ..factories import UserFactory +from apiVolontaria.models import ActionToken +from apiVolontaria.factories import UserFactory class ActionTokenTests(APITestCase): diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_model_Profile.py b/source/apiVolontaria/apiVolontaria/tests/tests_model_Profile.py index e1e2b4c8..894877fd 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_model_Profile.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_model_Profile.py @@ -1,8 +1,8 @@ from rest_framework.test import APITestCase from django.core.exceptions import ValidationError -from ..models import Profile -from ..factories import UserFactory +from apiVolontaria.models import Profile +from apiVolontaria.factories import UserFactory class ProfileTests(APITestCase): diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_view_ChangePassword.py b/source/apiVolontaria/apiVolontaria/tests/tests_view_ChangePassword.py index d138d505..93d4d101 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_view_ChangePassword.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_view_ChangePassword.py @@ -6,8 +6,8 @@ from django.urls import reverse from django.contrib.auth.models import User -from ..factories import UserFactory -from ..models import ActionToken +from apiVolontaria.factories import UserFactory +from apiVolontaria.models import ActionToken class ChangePasswordTests(APITestCase): diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_view_ResetPassword.py b/source/apiVolontaria/apiVolontaria/tests/tests_view_ResetPassword.py index 33e1a205..89fa71b0 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_view_ResetPassword.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_view_ResetPassword.py @@ -8,8 +8,8 @@ from django.urls import reverse from django.test.utils import override_settings -from ..factories import UserFactory -from ..models import ActionToken +from apiVolontaria.factories import UserFactory +from apiVolontaria.models import ActionToken from django.core import mail from anymail.exceptions import AnymailCancelSend diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_view_Users.py b/source/apiVolontaria/apiVolontaria/tests/tests_view_Users.py index cff00c8f..cc8b3a97 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_view_Users.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_view_Users.py @@ -7,10 +7,10 @@ from django.test.utils import override_settings from django.contrib.auth.models import User -from ..models import ActionToken +from apiVolontaria.models import ActionToken from location.models import Address, StateProvince, Country from volunteer.models import Cell, Event, Cycle, TaskType, Participation -from ..factories import UserFactory, AdminFactory +from apiVolontaria.factories import UserFactory, AdminFactory from django.core import mail from anymail.exceptions import AnymailCancelSend diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersActivation.py b/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersActivation.py index 7d476f88..b579678d 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersActivation.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersActivation.py @@ -6,8 +6,8 @@ from django.urls import reverse from django.contrib.auth.models import User -from ..factories import UserFactory -from ..models import ActionToken +from apiVolontaria.factories import UserFactory +from apiVolontaria.models import ActionToken class UsersActivationTests(APITestCase): diff --git a/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersId.py b/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersId.py index 496a131c..1999a097 100644 --- a/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersId.py +++ b/source/apiVolontaria/apiVolontaria/tests/tests_view_UsersId.py @@ -7,8 +7,8 @@ from location.models import Country, StateProvince, Address from volunteer.models import Cell -from .. import models -from ..factories import UserFactory, AdminFactory +from apiVolontaria import models +from apiVolontaria.factories import UserFactory, AdminFactory class UsersIdTests(APITestCase): diff --git a/source/apiVolontaria/apiVolontaria/urls.py b/source/apiVolontaria/apiVolontaria/urls.py index 44905e75..d0b564e6 100644 --- a/source/apiVolontaria/apiVolontaria/urls.py +++ b/source/apiVolontaria/apiVolontaria/urls.py @@ -20,11 +20,30 @@ from django.contrib.staticfiles.urls import staticfiles_urlpatterns from django.views.static import serve +from rest_framework.routers import DefaultRouter from rest_framework.documentation import include_docs_urls +from ckeditor_api.urls import ckeditor_router from .views import (ObtainTemporaryAuthToken, Users, UsersId, UsersActivation, ResetPassword, ChangePassword) + +class OptionalSlashDefaultRouter(DefaultRouter): + """ Subclass of DefaultRouter to make the trailing slash optional """ + def __init__(self, *args, **kwargs): + super(DefaultRouter, self).__init__(*args, **kwargs) + self.trailing_slash = '/?' + + +# Create a router and register our viewsets with it. +router = OptionalSlashDefaultRouter() + +# External workplace application +# Their urls are directly appended to the main router +# The retreat app is not included here because we needed a url prefix, thus +# it is included separately at the bottom of this file. +router.registry.extend(ckeditor_router.registry) + urlpatterns = [ # Token authentification url( @@ -82,6 +101,10 @@ r'^pages/', include('pages.urls', namespace="pages"), ), + path( + '', + include(router.urls) + ), # includes router generated URL # DOCUMENTATION SWAGGER path( 'docs/', diff --git a/source/apiVolontaria/ckeditor_api/__init__.py b/source/apiVolontaria/ckeditor_api/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/source/apiVolontaria/ckeditor_api/admin.py b/source/apiVolontaria/ckeditor_api/admin.py new file mode 100644 index 00000000..3aee06ad --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/admin.py @@ -0,0 +1,11 @@ +from django.contrib import admin + +from .models import CKEditorPage + + +@admin.register(CKEditorPage) +class CKEditorPageAdmin(admin.ModelAdmin): + readonly_fields = ( + 'updated_at', + 'created_at' + ) diff --git a/source/apiVolontaria/ckeditor_api/apps.py b/source/apiVolontaria/ckeditor_api/apps.py new file mode 100644 index 00000000..8d5679fc --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CkeditorApiConfig(AppConfig): + name = 'ckeditor_api' diff --git a/source/apiVolontaria/ckeditor_api/migrations/0001_initial.py b/source/apiVolontaria/ckeditor_api/migrations/0001_initial.py new file mode 100644 index 00000000..70acb902 --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/migrations/0001_initial.py @@ -0,0 +1,24 @@ +# Generated by Django 2.2.10 on 2020-03-18 21:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='CKEditorPage', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('key', models.CharField(max_length=255, unique=True, verbose_name='Key')), + ('data', models.TextField(blank=True, verbose_name='Data')), + ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')), + ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')), + ], + ), + ] diff --git a/source/apiVolontaria/ckeditor_api/migrations/__init__.py b/source/apiVolontaria/ckeditor_api/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/source/apiVolontaria/ckeditor_api/models.py b/source/apiVolontaria/ckeditor_api/models.py new file mode 100644 index 00000000..cb5ef3a3 --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/models.py @@ -0,0 +1,29 @@ +from django.db import models +from django.utils.translation import ugettext_lazy as _ + + +class CKEditorPage(models.Model): + + key = models.CharField( + verbose_name=_('Key'), + unique=True, + max_length=255 + ) + + data = models.TextField( + verbose_name=_('Data'), + blank=True + ) + + created_at = models.DateTimeField( + verbose_name=_('Created at'), + auto_now_add=True + ) + + updated_at = models.DateTimeField( + verbose_name=_('Updated at'), + auto_now=True + ) + + def __str__(self): + return self.key diff --git a/source/apiVolontaria/ckeditor_api/serializers.py b/source/apiVolontaria/ckeditor_api/serializers.py new file mode 100644 index 00000000..2fd06992 --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/serializers.py @@ -0,0 +1,13 @@ +from rest_framework import serializers + +from .models import ( + CKEditorPage +) + + +class CKEditorPageSerializer(serializers.HyperlinkedModelSerializer): + id = serializers.ReadOnlyField() + + class Meta: + model = CKEditorPage + fields = '__all__' diff --git a/source/apiVolontaria/ckeditor_api/urls.py b/source/apiVolontaria/ckeditor_api/urls.py new file mode 100644 index 00000000..8a455544 --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/urls.py @@ -0,0 +1,23 @@ +from rest_framework.routers import SimpleRouter +from django.urls import path +from django.conf.urls import include + +from . import views + + +class OptionalSlashSimpleRouter(SimpleRouter): + """ Subclass of SimpleRouter to make the trailing slash optional """ + + def __init__(self, *args, **kwargs): + super(SimpleRouter, self).__init__(*args, **kwargs) + self.trailing_slash = '/?' + + +app_name = "ckeditor_api" + +ckeditor_router = OptionalSlashSimpleRouter() +ckeditor_router.register('ckeditor_page', views.CKEditorPageViewSet) + +urlpatterns = [ + path('', include(ckeditor_router.urls)), # includes router generated URL +] diff --git a/source/apiVolontaria/ckeditor_api/views.py b/source/apiVolontaria/ckeditor_api/views.py new file mode 100644 index 00000000..3a6c0c11 --- /dev/null +++ b/source/apiVolontaria/ckeditor_api/views.py @@ -0,0 +1,16 @@ +from rest_framework import viewsets + +from apiVolontaria import permissions +from .models import ( + CKEditorPage +) + +from . import serializers + + +class CKEditorPageViewSet(viewsets.ModelViewSet): + + serializer_class = serializers.CKEditorPageSerializer + queryset = CKEditorPage.objects.all() + filterset_fields = '__all__' + permission_classes = [permissions.IsAdminOrReadOnly] diff --git a/source/apiVolontaria/location/tests/tests_model_Address.py b/source/apiVolontaria/location/tests/tests_model_Address.py index bb1c32fa..774ba7b6 100644 --- a/source/apiVolontaria/location/tests/tests_model_Address.py +++ b/source/apiVolontaria/location/tests/tests_model_Address.py @@ -2,7 +2,7 @@ from django.core.exceptions import ValidationError -from ..models import Address, Country, StateProvince +from location.models import Address, Country, StateProvince class AddressTests(APITestCase): diff --git a/source/apiVolontaria/location/tests/tests_model_Country.py b/source/apiVolontaria/location/tests/tests_model_Country.py index 468459ad..757b1559 100644 --- a/source/apiVolontaria/location/tests/tests_model_Country.py +++ b/source/apiVolontaria/location/tests/tests_model_Country.py @@ -1,6 +1,6 @@ from rest_framework.test import APITestCase -from ..models import Country +from location.models import Country class CountryTests(APITestCase): diff --git a/source/apiVolontaria/location/tests/tests_model_StateProvince.py b/source/apiVolontaria/location/tests/tests_model_StateProvince.py index 91040bd4..72ad965f 100644 --- a/source/apiVolontaria/location/tests/tests_model_StateProvince.py +++ b/source/apiVolontaria/location/tests/tests_model_StateProvince.py @@ -1,6 +1,6 @@ from rest_framework.test import APITestCase -from ..models import Country, StateProvince +from location.models import Country, StateProvince class StateProvinceTests(APITestCase): diff --git a/source/apiVolontaria/location/tests/tests_view_Addresses.py b/source/apiVolontaria/location/tests/tests_view_Addresses.py index 304514bf..9fb2cacb 100644 --- a/source/apiVolontaria/location/tests/tests_view_Addresses.py +++ b/source/apiVolontaria/location/tests/tests_view_Addresses.py @@ -7,7 +7,7 @@ from rest_framework.test import APIClient, APITestCase from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import Address, Country, StateProvince +from location.models import Address, Country, StateProvince class AddressesTests(APITestCase): diff --git a/source/apiVolontaria/location/tests/tests_view_Countries.py b/source/apiVolontaria/location/tests/tests_view_Countries.py index a8a22ce0..90e2c968 100644 --- a/source/apiVolontaria/location/tests/tests_view_Countries.py +++ b/source/apiVolontaria/location/tests/tests_view_Countries.py @@ -7,7 +7,7 @@ from rest_framework.test import APIClient, APITestCase from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import Country +from location.models import Country class CountriesTests(APITestCase): diff --git a/source/apiVolontaria/location/tests/tests_view_StateProvinces.py b/source/apiVolontaria/location/tests/tests_view_StateProvinces.py index 72ef9b3b..fa0bd311 100644 --- a/source/apiVolontaria/location/tests/tests_view_StateProvinces.py +++ b/source/apiVolontaria/location/tests/tests_view_StateProvinces.py @@ -7,7 +7,7 @@ from rest_framework.test import APIClient, APITestCase from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import StateProvince, Country +from location.models import StateProvince, Country class StateProvincesTests(APITestCase): diff --git a/source/apiVolontaria/pages/migrations/0003_auto_20200318_1716.py b/source/apiVolontaria/pages/migrations/0003_auto_20200318_1716.py new file mode 100644 index 00000000..2bbfff11 --- /dev/null +++ b/source/apiVolontaria/pages/migrations/0003_auto_20200318_1716.py @@ -0,0 +1,38 @@ +# Generated by Django 2.2.10 on 2020-03-18 21:16 + +import ckeditor.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('pages', '0002_auto_20190509_1544'), + ] + + operations = [ + migrations.AlterModelOptions( + name='infosection', + options={'ordering': ['sort_order'], 'verbose_name': 'Information Page section', 'verbose_name_plural': 'Information Page sections'}, + ), + migrations.AlterField( + model_name='infosection', + name='content', + field=ckeditor.fields.RichTextField(verbose_name='Content'), + ), + migrations.AlterField( + model_name='infosection', + name='is_accordion', + field=models.BooleanField(default=True, verbose_name='Accordion'), + ), + migrations.AlterField( + model_name='infosection', + name='is_active', + field=models.BooleanField(default=True, verbose_name='Active'), + ), + migrations.AlterField( + model_name='infosection', + name='title', + field=models.CharField(max_length=255, verbose_name='title'), + ), + ] diff --git a/source/apiVolontaria/pages/tests/tests_model_InfoSection.py b/source/apiVolontaria/pages/tests/tests_model_InfoSection.py index 3008fc40..219bd501 100644 --- a/source/apiVolontaria/pages/tests/tests_model_InfoSection.py +++ b/source/apiVolontaria/pages/tests/tests_model_InfoSection.py @@ -1,6 +1,6 @@ from rest_framework.test import APITransactionTestCase -from ..models import InfoSection +from pages.models import InfoSection class InfoSectionTests(APITransactionTestCase): diff --git a/source/apiVolontaria/pages/tests/tests_view_InfoPageView.py b/source/apiVolontaria/pages/tests/tests_view_InfoPageView.py index e666637e..fb322d8e 100644 --- a/source/apiVolontaria/pages/tests/tests_view_InfoPageView.py +++ b/source/apiVolontaria/pages/tests/tests_view_InfoPageView.py @@ -6,7 +6,7 @@ from django.urls import reverse from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import InfoSection +from pages.models import InfoSection class InfoPageViewTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/migrations/0009_auto_20200318_1716.py b/source/apiVolontaria/volunteer/migrations/0009_auto_20200318_1716.py new file mode 100644 index 00000000..30982adc --- /dev/null +++ b/source/apiVolontaria/volunteer/migrations/0009_auto_20200318_1716.py @@ -0,0 +1,19 @@ +# Generated by Django 2.2.10 on 2020-03-18 21:16 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('volunteer', '0008_cell_managers'), + ] + + operations = [ + migrations.AlterField( + model_name='event', + name='task_type', + field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='volunteer.TaskType', verbose_name='Task type'), + ), + ] diff --git a/source/apiVolontaria/volunteer/tests/tests_admin_Cycle.py b/source/apiVolontaria/volunteer/tests/tests_admin_Cycle.py index bb8658d8..9d49c14c 100644 --- a/source/apiVolontaria/volunteer/tests/tests_admin_Cycle.py +++ b/source/apiVolontaria/volunteer/tests/tests_admin_Cycle.py @@ -11,8 +11,8 @@ from apiVolontaria.models import Profile from location.models import Country, StateProvince, Address -from ..admin import CycleAdmin -from ..models import Participation, Cell, Cycle, TaskType, Event +from volunteer.admin import CycleAdmin +from volunteer.models import Participation, Cell, Cycle, TaskType, Event class ParticipationTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_admin_EventAdmin.py b/source/apiVolontaria/volunteer/tests/tests_admin_EventAdmin.py index 9da1185f..997bf64b 100644 --- a/source/apiVolontaria/volunteer/tests/tests_admin_EventAdmin.py +++ b/source/apiVolontaria/volunteer/tests/tests_admin_EventAdmin.py @@ -8,8 +8,8 @@ from apiVolontaria.models import Profile from location.models import Address, StateProvince, Country from volunteer.forms import EventAdminForm -from ..admin import EventAdmin -from ..models import Event, Cycle, Cell, TaskType +from volunteer.admin import EventAdmin +from volunteer.models import Event, Cycle, Cell, TaskType class EventAdminTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_admin_Participation.py b/source/apiVolontaria/volunteer/tests/tests_admin_Participation.py index e7ef34b1..7bf9ffb1 100644 --- a/source/apiVolontaria/volunteer/tests/tests_admin_Participation.py +++ b/source/apiVolontaria/volunteer/tests/tests_admin_Participation.py @@ -9,8 +9,8 @@ from apiVolontaria.models import Profile from location.models import Country, StateProvince, Address -from ..admin import ParticipationAdmin -from ..models import Participation, Cell, Cycle, TaskType, Event +from volunteer.admin import ParticipationAdmin +from volunteer.models import Participation, Cell, Cycle, TaskType, Event class ParticipationTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_model_Cell.py b/source/apiVolontaria/volunteer/tests/tests_model_Cell.py index 1ea9f9e5..309028b3 100644 --- a/source/apiVolontaria/volunteer/tests/tests_model_Cell.py +++ b/source/apiVolontaria/volunteer/tests/tests_model_Cell.py @@ -4,7 +4,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell +from volunteer.models import Cell class CellTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_model_Event.py b/source/apiVolontaria/volunteer/tests/tests_model_Event.py index d924112e..10351b0d 100644 --- a/source/apiVolontaria/volunteer/tests/tests_model_Event.py +++ b/source/apiVolontaria/volunteer/tests/tests_model_Event.py @@ -6,7 +6,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, TaskType, Cycle, Event, Participation +from volunteer.models import Cell, TaskType, Cycle, Event, Participation class EventTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_model_Participation.py b/source/apiVolontaria/volunteer/tests/tests_model_Participation.py index eade096f..9c9a13a2 100644 --- a/source/apiVolontaria/volunteer/tests/tests_model_Participation.py +++ b/source/apiVolontaria/volunteer/tests/tests_model_Participation.py @@ -9,7 +9,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, TaskType, Cycle, Event, Participation +from volunteer.models import Cell, TaskType, Cycle, Event, Participation class ParticipationTests(APITransactionTestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_Cell_Exportation.py b/source/apiVolontaria/volunteer/tests/tests_view_Cell_Exportation.py index 9f51625c..f967a4d4 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_Cell_Exportation.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_Cell_Exportation.py @@ -16,7 +16,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, Event, Cycle, TaskType, Participation +from volunteer.models import Cell, Event, Cycle, TaskType, Participation class CellExportationTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_Cells.py b/source/apiVolontaria/volunteer/tests/tests_view_Cells.py index 6a5d86ce..128099e2 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_Cells.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_Cells.py @@ -7,7 +7,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell +from volunteer.models import Cell class CellsTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_CellsId.py b/source/apiVolontaria/volunteer/tests/tests_view_CellsId.py index 79aac395..d9a4542b 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_CellsId.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_CellsId.py @@ -7,7 +7,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell +from volunteer.models import Cell class CellsIdTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_Events.py b/source/apiVolontaria/volunteer/tests/tests_view_Events.py index 02e157f5..238867a4 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_Events.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_Events.py @@ -8,7 +8,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, Event, Cycle, TaskType +from volunteer.models import Cell, Event, Cycle, TaskType class EventsTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_EventsId.py b/source/apiVolontaria/volunteer/tests/tests_view_EventsId.py index 2ccc9783..628d315c 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_EventsId.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_EventsId.py @@ -8,7 +8,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, Event, Cycle, TaskType +from volunteer.models import Cell, Event, Cycle, TaskType class EventsIdTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_Participations.py b/source/apiVolontaria/volunteer/tests/tests_view_Participations.py index 604ef486..d3a1e7ae 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_Participations.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_Participations.py @@ -11,7 +11,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, Event, Cycle, TaskType, Participation +from volunteer.models import Cell, Event, Cycle, TaskType, Participation class ParticipationsTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_view_ParticipationsId.py b/source/apiVolontaria/volunteer/tests/tests_view_ParticipationsId.py index 73336249..0bf1308a 100644 --- a/source/apiVolontaria/volunteer/tests/tests_view_ParticipationsId.py +++ b/source/apiVolontaria/volunteer/tests/tests_view_ParticipationsId.py @@ -11,7 +11,7 @@ from apiVolontaria.factories import UserFactory, AdminFactory from location.models import Address, StateProvince, Country -from ..models import Cell, Event, Cycle, TaskType, Participation +from volunteer.models import Cell, Event, Cycle, TaskType, Participation class ParticipationsIdTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_views_TaskTypes.py b/source/apiVolontaria/volunteer/tests/tests_views_TaskTypes.py index e29dd3b5..2595a6ba 100644 --- a/source/apiVolontaria/volunteer/tests/tests_views_TaskTypes.py +++ b/source/apiVolontaria/volunteer/tests/tests_views_TaskTypes.py @@ -5,7 +5,7 @@ from django.utils import timezone from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import TaskType +from volunteer.models import TaskType class TaskTypesTests(APITestCase): diff --git a/source/apiVolontaria/volunteer/tests/tests_views_TaskTypesId.py b/source/apiVolontaria/volunteer/tests/tests_views_TaskTypesId.py index 9bf5c5ce..42fa581a 100644 --- a/source/apiVolontaria/volunteer/tests/tests_views_TaskTypesId.py +++ b/source/apiVolontaria/volunteer/tests/tests_views_TaskTypesId.py @@ -5,7 +5,7 @@ from django.utils import timezone from apiVolontaria.factories import UserFactory, AdminFactory -from ..models import TaskType +from volunteer.models import TaskType class TaskTypesIdTests(APITestCase):