예제 #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 == '')
예제 #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 == "")
예제 #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 == '')
예제 #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)
예제 #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)
예제 #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)
예제 #7
0
 def __init__(self):
     """Initialize RawXmlModule"""
     self.parser = html.parser.HTMLParser()
     TextAreaModule.__init__(self, label="Raw XML", data="Insert XML Data here...")
예제 #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'),
]
예제 #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"),
]