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

from openprocurement.api.tests.base import snitch


from openprocurement.tender.belowthreshold.tests.document_blanks import (
    # TenderDocument ResourceTest
    not_found,
    create_tender_document,
    put_tender_document,
    patch_tender_document,
    # TenderDocumentResourceTest
    create_tender_document_json_invalid,
    create_tender_document_json,
    put_tender_document_json,
)

from openprocurement.tender.limited.tests.base import (
    BaseTenderContentWebTest,
    test_tender_data,
    test_tender_negotiation_data,
    test_tender_negotiation_quick_data
)


class TenderDocumentResourceTest(BaseTenderContentWebTest):
    initial_data = test_tender_data
    docservice = False
    test_forbidden_document_actions_status = "complete"

    test_not_found = snitch(not_found)
    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 TenderNegotiationDocumentResourceTest(TenderDocumentResourceTest):
    initial_data = test_tender_negotiation_data


class TenderNegotiationQuickDocumentResourceTest(TenderNegotiationDocumentResourceTest):
    initial_data = test_tender_negotiation_quick_data


class TenderDocumentWithDSResourceTest(TenderDocumentResourceTest):
    docservice = True

    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)


class TenderNegotiationDocumentWithDSResourceTest(TenderDocumentWithDSResourceTest):
    initial_data = test_tender_negotiation_data


class TenderNegotiationQuickDocumentWithDSResourceTest(TenderDocumentWithDSResourceTest):
    initial_data = test_tender_negotiation_quick_data


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


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

@@ -38,60 +38,8 @@
 st%0A%0A
-from openprocurement.api.tests.base import snitch%0A%0A%0A
 from
@@ -95,15 +95,8 @@
 ment
-_blanks
  imp
@@ -100,26 +100,24 @@
 import (%0A   
- #
  TenderDocum
@@ -119,17 +119,16 @@
 Document
- 
 Resource
@@ -135,240 +135,56 @@
 Test
-%0A    not_found,%0A    create_t
+Mixin,%0A    T
 ender
-_d
+D
 ocument
-,%0A    put_tender_document,%0A    patch_tender_document,%0A    # TenderDocumentResourceTest%0A    create_tender_document_json_invalid,%0A    create_tender_document_json,%0A    put_tender_document_json,
+WithDSResourceTestMixin
 %0A)%0A%0A
@@ -421,24 +421,57 @@
 ntentWebTest
+, TenderDocumentResourceTestMixin
 ):%0A    initi
@@ -581,235 +581,8 @@
 e%22%0A%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
 %0Acla
@@ -915,268 +915,71 @@
 Test
-):%0A    docservice = True%0A%0A    test_create_t
+, T
 ender
-_d
+D
 ocument
-_json_invalid = snitch(create_tender_document_json_invalid)%0A    test_create_tender_document_json = snitch(create_tender_document_json)%0A    test_put_tender_document_json = snitch(put_tender_document_json)
+WithDSResourceTestMixin):%0A    docservice = True
 %0A%0A%0Ac

create basic abstract classes for document module