-
Notifications
You must be signed in to change notification settings - Fork 51
Moderation configuration and copy method #77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Aiky30
merged 107 commits into
django-cms:support/django-cms-4.0.x
from
adam-murray:feature/moderation-configuration
Sep 17, 2021
Merged
Changes from all commits
Commits
Show all changes
107 commits
Select commit
Hold shift + click to select a range
6368d7e
Added cms_config versionable item and grouper
adam-murray 75449d6
Added admin, requirements for testing and requirements for running
adam-murray 9bc367c
Update
adam-murray 7c9455c
Fixed issue in setup.py and added basic first migration
adam-murray 4954ee4
Added migration to cms4
adam-murray 8defe7f
Added migration to cms4
adam-murray b9f822f
Began to implement versioning switch, added migration as part of mana…
adam-murray 49e4bb3
Moved data migration to management command, added util for versioning…
adam-murray dceee9f
Added tests for config as well as util for versioning check
adam-murray 7dfd721
Merge branch 'feature/versioned-snippets' into feature/snippet-data-m…
adam-murray 56adbdb
Updated cms_config
adam-murray 48e125f
Updated management command
adam-murray 5e12a63
Added form, updated model and forms to improve versioned and unversio…
adam-murray fdcde12
Updated migration, removed unecessary plugin
adam-murray 13547ae
Merged
adam-murray 9b73d59
Removed additional copies of files
adam-murray 680ce70
Split migration command into migration and command
adam-murray 8dc7f91
Updates to migration
adam-murray 6e937e8
Updates to migration
adam-murray 2df658b
Update migration for review
adam-murray 11a7d3e
Remove pdb
adam-murray d7c5dbb
Migration upgrade
adam-murray 8898232
Remove plugin from migration 10, added version creation
adam-murray 225b9f9
Implemented proper plugin migration
adam-murray 500cf72
Removed management command
adam-murray 2017d90
Migration 10 now handles lack of versioning gracefully.
adam-murray 25e552e
Add snippet property for backwards compatibility
adam-murray 59f82a8
Remove old foreign key from plugin, and rename new one
adam-murray 25048ff
Cleaned up migration and models
adam-murray 649c4af
Removed unecessary logging
adam-murray 061ebc4
Merged with target changes
adam-murray bc8d60e
Remove redundent comment
adam-murray 4103082
Update djangocms_snippet/migrations/0010_cms4_grouper_version_data_mi…
adam-murray ad25ec8
Update djangocms_snippet/migrations/0010_cms4_grouper_version_data_mi…
adam-murray 929d9d6
Update djangocms_snippet/migrations/0011_cms4_plugin_data_migration.py
adam-murray 8e624d9
Update djangocms_snippet/conf.py
adam-murray f7c848e
Update djangocms_snippet/migrations/0011_cms4_plugin_data_migration.py
adam-murray 85f96f2
Fixed variable name spelling mistake
adam-murray 669d34b
Merge branch 'feature/snippet-data-migration' of github.com:adam-murr…
adam-murray bea0a0a
Use util
adam-murray 9808226
Updated linting in migrations, and versioning enabled check
adam-murray 530e416
Added instructions for DJANGOCMS_SNIPPET_VERSIONING_MIGRATION_USER_ID…
adam-murray a3cdc9b
Added instructions for DJANGOCMS_SNIPPET_VERSIONING_MIGRATION_USER_ID…
adam-murray ce96a1f
Added instructions for DJANGOCMS_SNIPPET_VERSIONING_MIGRATION_USER_ID…
adam-murray c696c67
isort
adam-murray 3e3b736
Removed unecessary plugin
adam-murray 1aec683
Changed to version4 python version compatibility in test suite
adam-murray 7050f88
merge
adam-murray 53609d2
Updated to cms4 based test suite
adam-murray eac5cad
Merged
adam-murray 8dfb6db
Removed redundent abstract model
adam-murray ff5d635
Fixed app config issue
adam-murray c2f62de
Removed unused management command
adam-murray ef314fb
Removed management command
adam-murray 0ad68fe
Updates snippet tests for cms4
adam-murray f3943a3
linting
adam-murray a08485e
Removed unecessary published flag on page creation
adam-murray 7ff44b1
Merged
adam-murray 736b975
Push for testing
adam-murray 9dd2563
Updates to tests
adam-murray 4171e2e
Merged with versioned snippets
adam-murray 96035a3
Added factories, fixed model tests and templatetag tests
adam-murray 5b65538
Updated plugin tests
adam-murray aa62ced
Plugin tests now use factories
adam-murray 9fba572
Linting
adam-murray aeaa52a
Linting
adam-murray bdf4eaa
Fixed old issue with migrations
adam-murray aa5a54c
Fixed old issue with migrations
adam-murray 2d36a3b
Fixed spelling mistake
adam-murray a8f56f3
Updated test to no longer use factoris
adam-murray b87a0d6
Fixed rendering
adam-murray 7375e5b
Fixed migration error
adam-murray 03df8f7
Updated comments
adam-murray f895bf1
Migration linting
adam-murray e16c02c
Merge branch 'feature/snippet-data-migration' into feature/moderation…
adam-murray e4cf009
Made copy function test and started copy function
adam-murray 79eebf4
Remove unique=True from snipept slug field
adam-murray 6bf6557
Merge branch 'feature/snippet-data-migration' into feature/moderation…
adam-murray 38c211d
Removed unique=True on name
adam-murray 0cd495b
Enabled moderation, updates to cms_config
adam-murray 247ae36
Updated config test
adam-murray ee07ad5
Update djangocms_snippet/models.py
adam-murray 9b23fa8
Refactrogin
adam-murray 7cbaaa3
Merged
adam-murray 7cb6cc8
Linting
adam-murray b59a31d
Refactored test_plugin to closer to original
adam-murray 3153940
Refactoring tests
adam-murray 3d97dc8
Updated tests and migration to make grouper mandatory
adam-murray 366739b
Updated models to even with migrations
adam-murray 3853d19
Refactor
adam-murray e958a03
Linting
adam-murray d6b2a59
Merged with migration code
adam-murray c5c236b
Removed unused util
adam-murray dbfb808
Added migration and change for removing unique=True, allowing version…
adam-murray 8e599f3
Added checks for whether moderation is enabled
adam-murray 20ed1c8
Linting
adam-murray 463fd7c
Linting
adam-murray 1a7377a
Added additional test criteria
adam-murray 1859b13
Fixed test
adam-murray 2efcc9e
Merge branch 'feature/snippet-data-migration' into feature/moderation…
adam-murray ae215dc
merged with migration
adam-murray 59dc101
Updated models to match migration
adam-murray 691056c
Revert to default copy function, updated test
adam-murray 229c915
Linting
adam-murray 73dd9d8
Linting
adam-murray d0ba699
Remove duplicate variable declaration
adam-murray 39f4f22
Additional test case for copy method
adam-murray File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.2.24 on 2021-09-15 07:51 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('djangocms_snippet', '0012_auto_20210915_0721'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='snippet', | ||
name='name', | ||
field=models.CharField(max_length=255, verbose_name='Name'), | ||
), | ||
migrations.AlterField( | ||
model_name='snippet', | ||
name='slug', | ||
field=models.SlugField(default='', max_length=255, verbose_name='Slug'), | ||
), | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from django.apps import apps | ||
|
||
from cms.test_utils.testcases import CMSTestCase | ||
|
||
from djangocms_snippet.models import Snippet, SnippetGrouper | ||
|
||
from .utils.factories import SnippetWithVersionFactory | ||
|
||
|
||
class VersioningConfigTestCase(CMSTestCase): | ||
|
||
def test_snippet_copy_method(self): | ||
""" | ||
App should use the default copy method, and return an identical model (apart from PK) | ||
""" | ||
snippet_cms_config = apps.get_app_config("djangocms_snippet").cms_config | ||
old_snippet = SnippetWithVersionFactory( | ||
name="snippet", | ||
html="<p>Hello World</p>", | ||
slug="snippet", | ||
) | ||
|
||
new_snippet = snippet_cms_config.versioning[0].copy_function(old_snippet) | ||
|
||
self.assertNotEqual(old_snippet, new_snippet) | ||
self.assertEqual(old_snippet.name, new_snippet.name) | ||
self.assertEqual(old_snippet.html, new_snippet.html) | ||
self.assertEqual(old_snippet.snippet_grouper, new_snippet.snippet_grouper) | ||
self.assertEqual(1, SnippetGrouper.objects.count()) | ||
self.assertEqual(2, Snippet._base_manager.count()) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.