Skip to content
Snippets Groups Projects
Commit 7f33e4ec authored by Jerome Reybert's avatar Jerome Reybert
Browse files

test/addSelect*: add unstage by vselect test (ref #73)

parent 28075b0d
Branches
Tags
No related merge requests found
......@@ -56,4 +56,15 @@ Execute (Stage marks):
let diff=Git_diff('staged', Get_filename())
call Expect_diff(g:test_script_dir . 'addSelect/addSelect_' . Get_safe_filename() . '_4_marks_diff.expect', diff)
Execute (Unstage selection):
call Cd_test_sub()
Magit
call Search_file('staged')
call magit#open_close_folding(1)
%foldopen!
call Search_pattern("^+\t\tif product.cover_url is not '':$")
execute "normal! v4j:call magit#stage_vselect()\<cr>"
call Cd_test()
let diff=Git_diff('staged', Get_filename())
call Expect_diff(g:test_script_dir . 'addSelect/addSelect_' . Get_safe_filename() . '_5_vselect_diff.expect', diff)
Include: cleanup.inc
diff --git books/models.py books/models.py
--- books/models.py
+++ books/models.py
@@ -1,5 +1,9 @@
from django.db import models
+import urllib2 as urllib
+from PIL import Image
+import io
+
import isbn_search
class User(models.Model):
@@ -24,13 +28,16 @@ class BookManager(models.Manager):
)
return book
+def upload_path(book, filename):
+ return 'covers/%s/%s' % (book.isbn, filename)
+
class Book(models.Model):
isbn = models.CharField(max_length=10, unique=True)
- eisbn = models.CharField(max_length=13, blank=True)
+ eisbn = models.CharField(max_length=13, blank=True, null=True)
title = models.CharField(max_length=200)
author = models.CharField(max_length=200)
- edition = models.CharField(max_length=200, blank=True)
cover = models.ImageField(upload_to='covers', blank=True)
+ edition = models.CharField(max_length=200, blank=True, null=True)
def __unicode__(self):
return u'[%s] "%s" by %s' % (self.isbn, self.title, self.author,)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment