-
-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy path__init__.py
More file actions
24 lines (22 loc) · 684 Bytes
/
__init__.py
File metadata and controls
24 lines (22 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class CreateMixin(object):
def _create_book(self, **kwargs):
options = dict(name='test-book', author='test-author')
options.update(kwargs)
b = self.book_model(**options)
b.full_clean()
b.save()
return b
def _create_shelf(self, **kwargs):
options = dict(name='test-shelf')
options.update(kwargs)
s = self.shelf_model(**options)
s.full_clean()
s.save()
return s
def _create_template(self, **kwargs):
options = dict(name='test-template')
options.update(kwargs)
t = self.template_model(**options)
t.full_clean()
t.save()
return t