# -*- coding: utf-8 -*-
import unittest

from openprocurement.api.tests.base import snitch

from openprocurement.tender.belowthreshold.tests.base import (
    TenderContentWebTest
)
from openprocurement.tender.belowthreshold.tests.document_blanks import (
    # TenderDocumentResourceTest
    not_found,
    create_document_active_tendering_status,
    create_tender_document,
    put_tender_document,
    patch_tender_document,
    # TenderDocumentWithDSResourceTest
    create_tender_document_error,
    create_tender_document_json_invalid,
    create_tender_document_json,
    put_tender_document_json
)


class TenderDocumentResourceTest(TenderContentWebTest):
    test_forbidden_document_actions_status = 'active.tendering'

    test_not_found = snitch(not_found)
    test_create_document_active_tendering_status = snitch(create_document_active_tendering_status)
    test_create_tender_document = snitch(create_tender_document)
    test_put_tender_document = snitch(put_tender_document)
    test_patch_tender_document = snitch(patch_tender_document)


class TenderDocumentWithDSResourceTest(TenderDocumentResourceTest):

    docservice = True
    test_create_tender_document_error = snitch(create_tender_document_error)
    test_create_tender_document_json_invalid = snitch(create_tender_document_json_invalid)
    test_create_tender_document_json = snitch(create_tender_document_json)
    test_put_tender_document_json = snitch(put_tender_document_json)


def suite():
    suite = unittest.TestSuite()
    suite.addTest(unittest.makeSuite(TenderDocumentResourceTest))
    suite.addTest(unittest.makeSuite(TenderDocumentWithDSResourceTest))
    return suite


if __name__ == '__main__':
    unittest.main(defaultTest='suite')

@@ -638,234 +638,303 @@
 Test
-(TenderContentWebTest):%0A    test_forbidden_document_actions_status = 'active.tendering'%0A%0A    test_not_found = snitch(not_found)%0A    test_create_document_active_tendering_status = snitch(create_document_active_tendering_status)
+Mixin(object):%0A    test_not_found = snitch(not_found)%0A    test_create_tender_document = snitch(create_tender_document)%0A    test_put_tender_document = snitch(put_tender_document)%0A    test_patch_tender_document = snitch(patch_tender_document)%0A%0A%0Aclass TenderDocumentWithDSResourceTestMixin(object):
 %0A   
@@ -953,32 +953,45 @@
 _tender_document
+_json_invalid
  = snitch(create
@@ -998,32 +998,45 @@
 _tender_document
+_json_invalid
 )%0A    test_put_t
@@ -1022,35 +1022,38 @@
 valid)%0A    test_
-put
+create
 _tender_document
@@ -1044,32 +1044,37 @@
 _tender_document
+_json
  = snitch(put_te
@@ -1059,35 +1059,38 @@
 t_json = snitch(
-put
+create
 _tender_document
@@ -1081,32 +1081,37 @@
 _tender_document
+_json
 )%0A    test_patch
@@ -1098,36 +1098,34 @@
 json)%0A    test_p
-atch
+ut
 _tender_document
@@ -1116,32 +1116,37 @@
 _tender_document
+_json
  = snitch(patch_
@@ -1132,36 +1132,34 @@
 _json = snitch(p
-atch
+ut
 _tender_document
@@ -1150,32 +1150,37 @@
 _tender_document
+_json
 )%0A%0A%0Aclass Tender
@@ -1179,38 +1179,32 @@
 s TenderDocument
-WithDS
 ResourceTest(Ten
@@ -1210,76 +1210,76 @@
 nder
-DocumentResourceTest):%0A%0A    docservice = True%0A    test_create_tender
+ContentWebTest, TenderDocumentResourceTestMixin):%0A    test_forbidden
 _doc
@@ -1288,52 +1288,44 @@
 ent_
-error = snitch(create_tender_document_error)
+actions_status = 'active.tendering'%0A
 %0A   
@@ -1329,39 +1329,32 @@
     test_create_
-tender_
 document_json_in
@@ -1350,141 +1350,213 @@
 ent_
-json_invalid = snitch(create_tender_document_json_invalid)%0A    test_create_t
+active_tendering_status = snitch(create_document_active_tendering_status)%0A%0A%0Aclass TenderDocumentWithDSResourceTest(T
 ender
-_d
+D
 ocument
-_json = snitch(create_t
+ResourceTest, T
 ender
-_d
+D
 ocument
-_json)
+WithDSResourceTestMixin):%0A%0A    docservice = True
 %0A   
@@ -1553,35 +1553,38 @@
 = True%0A    test_
-put
+create
 _tender_document
@@ -1576,36 +1576,37 @@
 tender_document_
-json
+error
  = snitch(put_te
@@ -1591,35 +1591,38 @@
 _error = snitch(
-put
+create
 _tender_document
@@ -1618,28 +1618,29 @@
 er_document_
-json
+error
 )%0A%0A%0Adef suit

create basic abstract classes for document module