Nikos Atlas 9 місяців тому
батько
коміт
db00084dea
37 змінених файлів з 25 додано та 3 видалено
  1. 1 0
      .gitignore
  2. 2 1
      .idea/telecaster.iml
  3. 0 0
      src/.coverage
  4. 0 0
      src/db.sqlite3
  5. 0 0
      src/manage.py
  6. 0 0
      src/settings/__init__.py
  7. 0 0
      src/settings/development.py
  8. 0 0
      src/settings/production.py
  9. 0 0
      src/settings/test.py
  10. 0 0
      src/telecaster/Clients/BaseClient.py
  11. 0 0
      src/telecaster/Clients/PrestaShopClient.py
  12. 0 0
      src/telecaster/__init__.py
  13. 0 0
      src/telecaster/asgi.py
  14. 0 0
      src/telecaster/models/CategoryModel.py
  15. 0 0
      src/telecaster/models/ProductModel.py
  16. 0 0
      src/telecaster/models/__init__.py
  17. 0 0
      src/telecaster/parsers/cdata_parser.py
  18. 0 0
      src/telecaster/parsers/parse_xml_to_json.py
  19. 0 0
      src/telecaster/sanitizers/prestashop_backoffice_api_sanitizer.py
  20. 0 0
      src/telecaster/serializers/XmlGeneratorSerializer.py
  21. 0 0
      src/telecaster/serializers/__init__.py
  22. 0 0
      src/telecaster/settings.py
  23. 0 0
      src/telecaster/tests/conftest.py
  24. 0 0
      src/telecaster/tests/parsers/mock_categories_response.xml
  25. 0 0
      src/telecaster/tests/parsers/mock_products_response.xml
  26. 0 1
      src/telecaster/tests/parsers/test_presta_shop_parser.py
  27. 21 0
      src/telecaster/tests/test_cosmohome_xml.py
  28. 0 0
      src/telecaster/types/skroutz_cdata_fields.py
  29. 0 0
      src/telecaster/types/skroutz_required_fields.py
  30. 1 1
      src/telecaster/urls.py
  31. 0 0
      src/telecaster/views/XmlGeneratorView.py
  32. 0 0
      src/telecaster/views/__init__.py
  33. 0 0
      src/wsgi.py
  34. BIN
      telecaster/telecaster/__pycache__/__init__.cpython-38.pyc
  35. BIN
      telecaster/telecaster/__pycache__/settings.cpython-38.pyc
  36. BIN
      telecaster/telecaster/__pycache__/urls.cpython-38.pyc
  37. BIN
      telecaster/telecaster/__pycache__/wsgi.cpython-38.pyc

+ 1 - 0
.gitignore

@@ -1,3 +1,4 @@
+.idea/
 env/
 virtualenv/
 venv/

+ 2 - 1
.idea/telecaster.iml

@@ -2,10 +2,11 @@
 <module type="PYTHON_MODULE" version="4">
   <component name="NewModuleRootManager">
     <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
       <excludeFolder url="file://$MODULE_DIR$/virtualenv" />
       <excludeFolder url="file://$MODULE_DIR$/env" />
     </content>
-    <orderEntry type="inheritedJdk" />
+    <orderEntry type="jdk" jdkName="Python 3.11 (telecaster)" jdkType="Python SDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
   <component name="PyDocumentationSettings">

+ 0 - 0
telecaster/.coverage → src/.coverage


+ 0 - 0
telecaster/db.sqlite3 → src/db.sqlite3


+ 0 - 0
telecaster/manage.py → src/manage.py


+ 0 - 0
telecaster/settings/__init__.py → src/settings/__init__.py


+ 0 - 0
telecaster/settings/development.py → src/settings/development.py


+ 0 - 0
telecaster/settings/production.py → src/settings/production.py


+ 0 - 0
telecaster/settings/test.py → src/settings/test.py


+ 0 - 0
telecaster/telecaster/Clients/BaseClient.py → src/telecaster/Clients/BaseClient.py


+ 0 - 0
telecaster/telecaster/Clients/PrestaShopClient.py → src/telecaster/Clients/PrestaShopClient.py


+ 0 - 0
telecaster/telecaster/__init__.py → src/telecaster/__init__.py


+ 0 - 0
telecaster/telecaster/asgi.py → src/telecaster/asgi.py


+ 0 - 0
telecaster/telecaster/models/CategoryModel.py → src/telecaster/models/CategoryModel.py


+ 0 - 0
telecaster/telecaster/models/ProductModel.py → src/telecaster/models/ProductModel.py


+ 0 - 0
telecaster/telecaster/models/__init__.py → src/telecaster/models/__init__.py


+ 0 - 0
telecaster/telecaster/parsers/cdata_parser.py → src/telecaster/parsers/cdata_parser.py


+ 0 - 0
telecaster/telecaster/parsers/parse_xml_to_json.py → src/telecaster/parsers/parse_xml_to_json.py


+ 0 - 0
telecaster/telecaster/sanitizers/prestashop_backoffice_api_sanitizer.py → src/telecaster/sanitizers/prestashop_backoffice_api_sanitizer.py


+ 0 - 0
telecaster/telecaster/serializers/XmlGeneratorSerializer.py → src/telecaster/serializers/XmlGeneratorSerializer.py


+ 0 - 0
telecaster/telecaster/serializers/__init__.py → src/telecaster/serializers/__init__.py


+ 0 - 0
telecaster/telecaster/settings.py → src/telecaster/settings.py


+ 0 - 0
telecaster/telecaster/tests/conftest.py → src/telecaster/tests/conftest.py


+ 0 - 0
telecaster/telecaster/tests/parsers/mock_categories_response.xml → src/telecaster/tests/parsers/mock_categories_response.xml


+ 0 - 0
telecaster/telecaster/tests/parsers/mock_products_response.xml → src/telecaster/tests/parsers/mock_products_response.xml


+ 0 - 1
telecaster/telecaster/tests/parsers/test_presta_shop_parser.py → src/telecaster/tests/parsers/test_presta_shop_parser.py

@@ -2,7 +2,6 @@ import sys
 
 import pytest
 import os
-from telecaster.telecaster.parsers.PrestaShopParser import PrestaShopParser
 
 
 @pytest.fixture

+ 21 - 0
src/telecaster/tests/test_cosmohome_xml.py

@@ -0,0 +1,21 @@
+import pytest
+from django.urls import reverse
+from rest_framework.test import APIClient
+from unittest.mock import patch
+
+def test_post_method(django_db_setup):
+    # Create a client to make requests
+    client = APIClient()
+
+    # Define your test url and token
+    test_url = 'http://test.com'
+    test_token = 'test_token'
+
+    # Make a post request to your view
+    response = client.post(reverse('xml-generator-view'), {'url': test_url, 'token': test_token})  # Replace 'xml_generator_view' with your actual view name
+
+    # Assert the status code is 200
+    assert response.status_code == 200
+    # Assert the content type is 'text/xml'
+    assert response['content-type'] == 'text/xml'
+    # Here you can add your additional asserts (like checking the response content)

+ 0 - 0
telecaster/telecaster/types/skroutz_cdata_fields.py → src/telecaster/types/skroutz_cdata_fields.py


+ 0 - 0
telecaster/telecaster/types/skroutz_required_fields.py → src/telecaster/types/skroutz_required_fields.py


+ 1 - 1
telecaster/telecaster/urls.py → src/telecaster/urls.py

@@ -22,6 +22,6 @@ from .views import XmlGeneratorView
 router = routers.SimpleRouter(trailing_slash=False)
 
 urlpatterns = [
-    re_path(r'^generate/xml', view=XmlGeneratorView.as_view()),
+    re_path(r'^generate/xml', view=XmlGeneratorView.as_view(), name='xml-generator-view'),
     path('admin/', admin.site.urls),
 ]

+ 0 - 0
telecaster/telecaster/views/XmlGeneratorView.py → src/telecaster/views/XmlGeneratorView.py


+ 0 - 0
telecaster/telecaster/views/__init__.py → src/telecaster/views/__init__.py


+ 0 - 0
telecaster/wsgi.py → src/wsgi.py


BIN
telecaster/telecaster/__pycache__/__init__.cpython-38.pyc


BIN
telecaster/telecaster/__pycache__/settings.cpython-38.pyc


BIN
telecaster/telecaster/__pycache__/urls.cpython-38.pyc


BIN
telecaster/telecaster/__pycache__/wsgi.cpython-38.pyc