Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
thalia
concrexit
Commits
b0817497
Verified
Commit
b0817497
authored
May 10, 2017
by
Sébastiaan Versteeg
Browse files
Fix photos migrations
parent
02df6596
Changes
2
Hide whitespace changes
Inline
Side-by-side
website/photos/migrations/0010_merge_20170510_2047.py
0 → 100644
View file @
b0817497
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-05-10 18:47
from
__future__
import
unicode_literals
from
django.db
import
migrations
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'photos'
,
'0008_auto_20170503_2101'
),
(
'photos'
,
'0009_auto_20170503_2001'
),
]
operations
=
[
]
website/photos/tests.py
View file @
b0817497
...
...
@@ -32,7 +32,8 @@ class AlbumUploadTest(TestCase):
def
test_album_upload
(
self
):
output_file
=
create_zip
([
"photos/fixtures/thom_assessor.png"
])
self
.
client
.
post
(
'/admin/photos/album/add/'
,
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
,
"album_archive"
:
output_file
},
...
...
@@ -43,12 +44,14 @@ class AlbumUploadTest(TestCase):
def
test_album_create_album_twice
(
self
):
self
.
client
.
post
(
'/admin/photos/album/add/'
,
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
},
follow
=
True
)
self
.
client
.
post
(
'/admin/photos/album/add/'
,
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
},
follow
=
True
)
...
...
@@ -58,7 +61,8 @@ class AlbumUploadTest(TestCase):
def
test_album_upload_same_photo_twice_in_album
(
self
):
output_file
=
create_zip
([
"photos/fixtures/thom_assessor.png"
])
self
.
client
.
post
(
'/admin/photos/album/add/'
,
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
,
"album_archive"
:
output_file
},
...
...
@@ -66,7 +70,8 @@ class AlbumUploadTest(TestCase):
pk
=
Album
.
objects
.
first
().
pk
self
.
client
.
post
(
'/admin/photos/album/{}/change/'
.
format
(
pk
),
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
,
"album_archive"
:
output_file
},
...
...
@@ -78,7 +83,8 @@ class AlbumUploadTest(TestCase):
def
test_album_upload_different_photo_in_album
(
self
):
output_file
=
create_zip
([
"photos/fixtures/thom_assessor.png"
])
self
.
client
.
post
(
'/admin/photos/album/add/'
,
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
,
"album_archive"
:
output_file
},
...
...
@@ -87,7 +93,8 @@ class AlbumUploadTest(TestCase):
output_file
=
create_zip
([
"photos/fixtures/janbeleid-hoe.jpg"
])
pk
=
Album
.
objects
.
first
().
pk
self
.
client
.
post
(
'/admin/photos/album/{}/change/'
.
format
(
pk
),
{
"title"
:
"test album"
,
{
"title_nl"
:
"test album"
,
"title_en"
:
"test album"
,
"date"
:
"2017-04-12"
,
"slug"
:
"2017-04-12-test-album"
,
"album_archive"
:
output_file
},
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment