зеркало из https://github.com/mozilla/normandy.git
Merge pull request #1134 from rehandalal/ditch-reversion
Ditch reversion
This commit is contained in:
Коммит
35bcfb451f
|
@ -2,11 +2,9 @@ from django.contrib import admin
|
|||
|
||||
from normandy.recipes import models
|
||||
|
||||
from reversion.admin import VersionAdmin
|
||||
|
||||
|
||||
@admin.register(models.Action)
|
||||
class ActionAdmin(VersionAdmin):
|
||||
class ActionAdmin(admin.ModelAdmin):
|
||||
list_display = ['name', 'implementation_hash']
|
||||
fieldsets = [
|
||||
[None, {
|
||||
|
|
|
@ -5,7 +5,6 @@ from django.conf import settings
|
|||
from django.core.management.base import BaseCommand
|
||||
from django.db import transaction
|
||||
|
||||
from reversion import revisions as reversion
|
||||
from webpack_loader.utils import get_loader
|
||||
|
||||
from normandy.recipes.models import Action
|
||||
|
@ -23,10 +22,7 @@ class Command(BaseCommand):
|
|||
)
|
||||
|
||||
@transaction.atomic
|
||||
@reversion.create_revision()
|
||||
def handle(self, *args, **options):
|
||||
reversion.set_comment('Updating actions.')
|
||||
|
||||
action_names = settings.ACTIONS.keys()
|
||||
if options['action_name']:
|
||||
action_names = [name for name in action_names if name in options['action_name']]
|
||||
|
|
|
@ -4,7 +4,6 @@ from datetime import timedelta
|
|||
from django.core.management import call_command
|
||||
|
||||
import pytest
|
||||
from reversion.models import Version
|
||||
|
||||
from normandy.base.tests import UserFactory
|
||||
from normandy.recipes.models import Action
|
||||
|
@ -100,19 +99,6 @@ class TestUpdateActions(object):
|
|||
dont_update_action.refresh_from_db()
|
||||
assert dont_update_action.implementation == 'old'
|
||||
|
||||
def test_it_sets_the_revision_comment(self, mock_action):
|
||||
mock_action('test-action', 'console.log("foo");', {'type': 'int'})
|
||||
|
||||
call_command('update_actions')
|
||||
assert Action.objects.count() == 1
|
||||
|
||||
action = Action.objects.all()[0]
|
||||
versions = Version.objects.get_for_object(action)
|
||||
assert versions.count() == 1
|
||||
|
||||
version = versions[0]
|
||||
assert version.revision.comment == 'Updating actions.'
|
||||
|
||||
|
||||
class TestUpdateSignatures(object):
|
||||
@pytest.mark.django_db
|
||||
|
|
|
@ -20,7 +20,6 @@ class Core(Configuration):
|
|||
'rest_framework',
|
||||
'rest_framework.authtoken',
|
||||
'rest_framework_swagger',
|
||||
'reversion',
|
||||
'storages',
|
||||
'raven.contrib.django.raven_compat',
|
||||
'webpack_loader',
|
||||
|
|
|
@ -34,8 +34,6 @@ django-npm==0.1.4 \
|
|||
django-rest-swagger==2.1.1 \
|
||||
--hash=sha256:36b9d97d259c10a7a96a24b81d4b0933cdd359298ad1a006dce6d9622f46ff59 \
|
||||
--hash=sha256:6ef17b12456dac9434e44357480e323812bee3087579d14e046f6091de6a15d0
|
||||
django-reversion==2.0.4 \
|
||||
--hash=sha256:a95624e28e72ef0b07231e601abe6fc790cd5e9e54791a1e57ff5eb2b1c0bc32
|
||||
django-storages==1.5.2 \
|
||||
--hash=sha256:60fe20cbf31eeda4e6065039646b6abecc45d6cc41246dd198c477031d848ffa \
|
||||
--hash=sha256:470b67b325abfd7f82362cfcb09cceba19f1f9499b42ace0f998aa75a05297c7
|
||||
|
|
Загрузка…
Ссылка в новой задаче