File tree Expand file tree Collapse file tree 4 files changed +68
-0
lines changed Expand file tree Collapse file tree 4 files changed +68
-0
lines changed Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
Original file line number Diff line number Diff line change
1
+ # requirements from setup.py
2
+ # other requirements
3
+ djangocms-helper >= 0.9.2 ,< 0.10
4
+ tox
5
+ coverage
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # -*- coding: utf-8 -*-
3
+
4
+ HELPER_SETTINGS = {
5
+ 'INSTALLED_APPS' : [
6
+ 'easy_thumbnails' ,
7
+ 'filer' ,
8
+ 'mptt' ,
9
+ ],
10
+ 'ALLOWED_HOSTS' : ['localhost' ],
11
+ 'CMS_LANGUAGES' : {
12
+ 1 : [{
13
+ 'code' : 'en' ,
14
+ 'name' : 'English' ,
15
+ }]
16
+ },
17
+ 'LANGUAGE_CODE' : 'en' ,
18
+ }
19
+
20
+ def run ():
21
+ from djangocms_helper import runner
22
+ runner .cms ('djangocms_file' )
23
+
24
+ if __name__ == '__main__' :
25
+ run ()
Original file line number Diff line number Diff line change
1
+ # -*- coding: utf-8 -*-
2
+ from django .test import TestCase
3
+
4
+ from filer .models import File as FilerFile
5
+ from filer .models import Folder as FilerFolder
6
+
7
+ from djangocms_file .models import File
8
+
9
+
10
+ class FileTestCase (TestCase ):
11
+
12
+ def setUp (self ):
13
+ filer_file = FilerFile .objects .create (
14
+ file = 'test.jpg' ,
15
+ )
16
+ File .objects .create (
17
+ file_src = filer_file ,
18
+ file_name = 'test' ,
19
+ )
20
+
21
+ def test_file_instance (self ):
22
+ """File instance has been created"""
23
+ test_file = File .objects .get (file_name = 'test' )
24
+ self .assertEqual (test_file .file_name , 'test' )
25
+
26
+
27
+ class FolderTestCase (TestCase ):
28
+
29
+ def setUp (self ):
30
+ FilerFolder .objects .create (
31
+ name = 'test' ,
32
+ )
33
+
34
+ def test_folder_instance (self ):
35
+ """Folder instance has been created"""
36
+ test_folder = FilerFolder .objects .get (name = 'test' )
37
+ self .assertEqual (test_folder .name , 'test' )
You can’t perform that action at this time.
0 commit comments