Commit f9b7200e authored by Florent Chehab's avatar Florent Chehab

Orthographe : Versionning => versioning

parent f3cbb6c7
Pipeline #26704 passed with stages
in 2 minutes and 53 seconds
# Generated by Django 2.0.3 on 2018-08-28 19:28
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('backend', '0020_auto_20180827_1026'),
]
operations = [
migrations.RenameModel(
old_name='ForTestingVersionning',
new_name='ForTestingVersioning',
),
]
......@@ -4,4 +4,4 @@ from .myModelViewSet import MyModelViewSet # noqa: F401
from .pendingModeration import PendingModeration, PendingModerationSerializer, PendingModerationViewSet # noqa: F401
from .forTestingModeration import ForTestingModeration, ForTestingModerationSerializer, ForTestingModerationViewSet # noqa: F401
from .myModelVersionned import MyModelVersionned, MyModelVersionnedSerializer, MyModelVersionnedViewSet, VersionViewSet # noqa: F401
from .forTestingVersionning import ForTestingVersionning, ForTestingVersionningSerializer, ForTestingVersionningViewSet # noqa: F401
from .forTestingVersioning import ForTestingVersioning, ForTestingVersioningSerializer, ForTestingVersioningViewSet # noqa: F401
......@@ -4,7 +4,7 @@ import reversion
@reversion.register()
class ForTestingVersionning(MyModelVersionned):
class ForTestingVersioning(MyModelVersionned):
"""
Simple model for testing purposes
"""
......@@ -12,21 +12,21 @@ class ForTestingVersionning(MyModelVersionned):
@classmethod
def get_serializer(cls):
return ForTestingVersionningSerializer
return ForTestingVersioningSerializer
class ForTestingVersionningSerializer(MyModelVersionnedSerializer):
class ForTestingVersioningSerializer(MyModelVersionnedSerializer):
"""
Same as above
"""
class Meta:
model = ForTestingVersionning
model = ForTestingVersioning
fields = '__all__'
class ForTestingVersionningViewSet(MyModelVersionnedViewSet):
class ForTestingVersioningViewSet(MyModelVersionnedViewSet):
"""
Same as above
"""
serializer_class = ForTestingVersionningSerializer
queryset = ForTestingVersionning.objects.all()
serializer_class = ForTestingVersioningSerializer
queryset = ForTestingVersioning.objects.all()
......@@ -14,7 +14,7 @@ class MyModelVersionned(MyModel):
def get_serializer(cls):
"""
This function is required for handling
versionning easily.
versioning easily.
You have to put the correct value in each subclass
"""
raise Exception("Get_serializer must be redifined in subclass")
......
from backend.models.my_model import ForTestingVersionning
from backend.models.my_model import ForTestingVersioning
from reversion.models import Version
from backend.signals import squashRevisionByUser
import reversion
......@@ -9,7 +9,7 @@ import json
class SquashVersionsTestCase(WithUserTestCase):
def setUp(self):
self.obj = ForTestingVersionning(bbb="v1")
self.obj = ForTestingVersioning(bbb="v1")
with reversion.create_revision():
self.obj.save()
reversion.set_user(self.authenticated_user)
......
from .withUserTestCase import WithUserTestCase
from backend.models.my_model import ForTestingVersionning
from backend.models.my_model import ForTestingVersioning
from django.conf import settings
from reversion.models import Version
from backend.signals import new_revision_saved
from django.test import override_settings
class VersionningTestCase(WithUserTestCase):
class VersioningTestCase(WithUserTestCase):
@classmethod
def setUpMoreTestData(cls):
cls.testing_model = ForTestingVersionning
cls.api_versionning = '/api/test/versionning/'
cls.testing_model = ForTestingVersioning
cls.api_versioning = '/api/test/versioning/'
def reset_signal_called(self):
self.signal_was_called = False
......@@ -23,7 +23,7 @@ class VersionningTestCase(WithUserTestCase):
def _submit_put_test(self, client, data, pk):
response = client.put(
self.api_versionning + str(pk) + '/',
self.api_versioning + str(pk) + '/',
data,
format='json'
)
......@@ -40,9 +40,9 @@ class VersionningTestCase(WithUserTestCase):
####
@override_settings(MODERATION_ACTIVATED=False)
def test_versionning(self):
def test_versioning(self):
"""
Test to check that versionning is working
Test to check that versioning is working
We also check that new_revision_saved is called
"""
......@@ -53,7 +53,7 @@ class VersionningTestCase(WithUserTestCase):
data_1 = {'bbb': "Test 1"}
response = self.authenticated_client.post(
self.api_versionning,
self.api_versioning,
data_1,
format='json'
)
......@@ -67,7 +67,7 @@ class VersionningTestCase(WithUserTestCase):
data_2 = {'bbb': "Test 2"}
response = self.authenticated_client_2.put(
self.api_versionning + str(instance.pk) + '/',
self.api_versioning + str(instance.pk) + '/',
data_2,
format='json'
)
......
......@@ -68,9 +68,9 @@ router = routers.DefaultRouter()
if settings.TESTING:
from backend.models.my_model import ForTestingModerationViewSet
from backend.models.my_model import ForTestingVersionningViewSet
from backend.models.my_model import ForTestingVersioningViewSet
router.register(r'test/moderation', ForTestingModerationViewSet)
router.register(r'test/versionning', ForTestingVersionningViewSet)
router.register(r'test/versioning', ForTestingVersioningViewSet)
router.register(r'country', CountryViewSet)
router.register(r'city', CityViewSet)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment