Esempio n. 1
0
 def test_text_area_module_render_data_returns_always_empty(self):
     # Arrange
     request = HttpRequest()
     data = 'dummy text'
     my_module = TextAreaModule()
     my_module.data = data
     # Act
     result = my_module._render_data(request)
     self.assertEqual(True, result == '')
Esempio n. 2
0
 def test_text_area_module_retrieve_data_returns_empty_if_no_selected_data_given(
     self, ):
     # Arrange
     request = HttpRequest()
     request.method = "POST"
     request.POST = {}
     my_module = TextAreaModule()
     # Act
     result = my_module._retrieve_data(request)
     self.assertEqual(True, result == "")
Esempio n. 3
0
 def test_text_area_module_retrieve_data_returns_empty_if_no_data_given(
         self):
     # Arrange
     request = HttpRequest()
     request.method = 'GET'
     request.GET = {}
     my_module = TextAreaModule()
     # Act
     result = my_module._retrieve_data(request)
     self.assertEqual(True, result == '')
Esempio n. 4
0
 def test_text_area_module_retrieve_data_returns_element_if_data_given(
         self):
     # Arrange
     request = HttpRequest()
     data = "dummy text"
     request.method = "GET"
     request.GET = {
         "data": data,
     }
     my_module = TextAreaModule()
     # Act
     result = my_module._retrieve_data(request)
     self.assertEqual(True, result == data)
Esempio n. 5
0
 def test_text_area_module_retrieve_data_returns_element_if_selected_data_given(
     self, ):
     # Arrange
     request = HttpRequest()
     label = "descritpion"
     data = "dummy text"
     request.method = "POST"
     request.POST = {
         "label": label,
         "data": data,
     }
     my_module = TextAreaModule()
     # Act
     result = my_module._retrieve_data(request)
     self.assertEqual(True, result == data)
Esempio n. 6
0
 def test_text_area_module_retrieve_data_returns_element_if_selected_data_given(
         self):
     # Arrange
     request = HttpRequest()
     label = 'descritpion'
     data = 'dummy text'
     request.method = 'POST'
     request.POST = {
         'label': label,
         'data': data,
     }
     my_module = TextAreaModule()
     # Act
     result = my_module._retrieve_data(request)
     self.assertEqual(True, result == data)
Esempio n. 7
0
 def __init__(self):
     """Initialize RawXmlModule"""
     self.parser = html.parser.HTMLParser()
     TextAreaModule.__init__(self, label="Raw XML", data="Insert XML Data here...")
Esempio n. 8
0
""" Url router for the Text Area module
"""
from django.conf.urls import url

from core_module_text_area_app.views.views import TextAreaModule

urlpatterns = [
    url(r'module-text-area', TextAreaModule.as_view(), name='core_module_text_area_view'),
]
Esempio n. 9
0
""" Url router for the Text Area module
"""

from django.urls import re_path

from core_module_text_area_app.views.views import TextAreaModule

urlpatterns = [
    re_path(r"module-text-area",
            TextAreaModule.as_view(),
            name="core_module_text_area_view"),
]