|
@@ -1,11 +1,11 @@
|
1
|
1
|
# -*- coding: utf-8 -*-
|
2
|
2
|
import time
|
3
|
3
|
|
|
4
|
+from depot.fields.upload import UploadedFile
|
4
|
5
|
from nose.tools import ok_
|
5
|
6
|
from nose.tools import raises
|
6
|
7
|
from sqlalchemy.sql.elements import and_
|
7
|
8
|
from sqlalchemy.testing import eq_
|
8
|
|
-from depot.fields.upload import UploadedFile
|
9
|
9
|
|
10
|
10
|
from tracim.lib.content import ContentApi
|
11
|
11
|
from tracim.lib.exception import ContentRevisionUpdateError
|
|
@@ -204,10 +204,12 @@ class TestContent(TestStandard):
|
204
|
204
|
# tests uninitialized depot file
|
205
|
205
|
eq_(content.depot_file, None)
|
206
|
206
|
# initializes depot file
|
|
207
|
+ # which is able to behave like a python file object
|
207
|
208
|
content.depot_file = b'test'
|
208
|
209
|
# tests initialized depot file
|
209
|
210
|
ok_(content.depot_file)
|
210
|
211
|
# tests type of initialized depot file
|
211
|
212
|
eq_(type(content.depot_file), UploadedFile)
|
212
|
213
|
# tests content of initialized depot file
|
|
214
|
+ # using depot_file.file of type StoredFile to fetch content back
|
213
|
215
|
eq_(content.depot_file.file.read(), b'test')
|