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