Skip to content

Commit f27154c

Browse files
committed
fix tests
1 parent 327bbbf commit f27154c

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

cms/models.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ def auto_save_post_to_git(sender, instance, created, **kwargs):
470470
instance = Post.objects.get(pk=instance.pk)
471471

472472
data = {
473-
"uuid": instance.uuid,
474473
"title": instance.title,
475474
"subtitle": instance.subtitle,
476475
"slug": instance.slug,
@@ -502,6 +501,9 @@ def auto_save_post_to_git(sender, instance, created, **kwargs):
502501
"author_tags": [tag.name for tag in instance.author_tags.all()],
503502
}
504503

504+
if instance.uuid:
505+
data.update({'uuid': instance.uuid})
506+
505507
# NOTE: If newly created always give it the highest ordering position
506508
if created:
507509
Post.objects.exclude(pk=instance.pk).update(position=F('position') + 1)
@@ -546,7 +548,6 @@ def auto_delete_post_to_git(sender, instance, **kwargs):
546548
def auto_save_category_to_git(sender, instance, created, **kwargs):
547549

548550
data = {
549-
"uuid": instance.uuid,
550551
"title": instance.title,
551552
"subtitle": instance.subtitle,
552553
"slug": instance.slug,
@@ -562,6 +563,9 @@ def auto_save_category_to_git(sender, instance, created, **kwargs):
562563
"image_host": settings.THUMBOR_SERVER,
563564
}
564565

566+
if instance.uuid:
567+
data.update({'uuid': instance.uuid})
568+
565569
workspace = EG.workspace(settings.GIT_REPO_PATH,
566570
index_prefix=settings.ELASTIC_GIT_INDEX_PREFIX,
567571
es={'urls': [settings.ELASTICSEARCH_HOST]})

test_settings.py

+6
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,9 @@
1616
GIT_REPO_URL = None
1717
GIT_REPO_PATH = abspath('cmsrepo_test')
1818
CELERY_ALWAYS_EAGER = DEBUG
19+
20+
ELASTIC_GIT_INDEX_PREFIX = ''
21+
22+
THUMBOR_SERVER = 'http://localhost:8888'
23+
THUMBOR_SECURITY_KEY = 'MY_SECURE_KEY'
24+
THUMBOR_RW_SERVER = 'http://localhost:8888'

0 commit comments

Comments
 (0)