Repository: oppia/oppia

Issue:
Exploration Migration failing in testserver
Exploration migration manager job is failing in test server because of exploration validation check.

Few logs:
```
Invalid html: <p>That's not right. Try using the API Explorer (<oppia-noninteractive-link url-with-value=\"&amp;quot;https://developers.google.com/+/api/latest/activities/get#try-it&amp;quot;\"></oppia-noninteractive-link>).</p> due to errors in customization_args: {\"Missing attributes: [u'text-with-value'], Extra attributes: []\"

```

```
Invalid html: <p><oppia-noninteractive-link text-with-value="&amp;quot;oooo&amp;quot;" url-with-value="&amp;quot;www.oppia.org&amp;quot;"></oppia-noninteractive-link> jjjj</p> due to errors in customization
```

```
File "/<path>/core/domain/state_domain.py", line 1259, in validate
    'strings: %s' % (self.html, err_dict))
ValidationError: Invalid html: <p>\xa0</p><p>
</p><oppia-noninteractive-collapsible content-with-value="&amp;quot;&amp;lt;p&amp;gt;inner&amp;lt;/p&amp;gt;&amp;quot;" heading-with-value="&amp;quot;Title&amp;quot;"></oppia-noninteractive-collapsible><p>
</p><p>\xa0</p><p>
</p><p>Lorem ipsum Lorem ipsum</p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><oppia-noninteractive-image alt-with-value="&amp;quot;The oppia otter&amp;quot;" caption-with-value="&amp;quot;Otter&amp;quot;" filepath-with-value="&amp;quot;img_20180709_101312_sfa9oi04bv_height_133_width_133.png&amp;quot;"></oppia-noninteractive-image><p>
</p><p><span></span></p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><oppia-noninteractive-video autoplay-with-value="true" end-with-value="&amp;quot;&amp;quot;" start-with-value="&amp;quot;&amp;quot;" video_id-with-value="&amp;quot;OConyxG7HaM&amp;quot;"></oppia-noninteractive-video><p>
</p><p><oppia-noninteractive-math raw_latex-with-value="&amp;quot;y=ax^4 + bx^3 + cx^2 + dx^1 + e&amp;quot;"></oppia-noninteractive-math></p><p>
</p><p><oppia-noninteractive-link text-with-value="&amp;quot;Oppia&amp;quot;" url-with-value="&amp;quot;https://www.oppia.org&amp;quot;"></oppia-noninteractive-link><br>
\xa0</p><p>
</p><oppia-noninteractive-tabs tab_contents-with-value="[{&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 1&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 1&amp;quot;}, {&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 2&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 2&amp;quot;}]"></oppia-noninteractive-tabs><p>
</p><p>\xa0</p><p>
</p><pre>Hello World!</pre><p>
</p><ol><li>
</li><li>Item 1</li><li>
</li><li>Item 2</li><li>
</li><li>Item 3</li><li>
</li><li>Item 4
	<ul><li>
</li><li>Item a</li><li>
</li><li>Item b</li><li>
</li><li><strong>Item c</strong></li><li>
</li><li><strong><em>Item d</em></strong></li><li>
</li><li><strong><em>snsdjz</em></strong></li><li>
</li></ul>
</li><li>
</li><li><strong><em>dsjfsfv</em></strong></li><li>
</li></ol><p>
</p><div>\xa0</div><p>
</p> for rte with invalid tags and strings: {'invalidTags': [u'div', u'span'], 'strings': [u'<p>\xa0</p><p>\n</p><oppia-noninteractive-collapsible content-with-value="&amp;quot;&amp;lt;p&amp;gt;inner&amp;lt;/p&amp;gt;&amp;quot;" heading-with-value="&amp;quot;Title&amp;quot;"></oppia-noninteractive-collapsible><p>\n</p><p>\xa0</p><p>\n</p><p>Lorem ipsum Lorem ipsum</p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><oppia-noninteractive-image alt-with-value="&amp;quot;The oppia otter&amp;quot;" caption-with-value="&amp;quot;Otter&amp;quot;" filepath-with-value="&amp;quot;img_20180709_101312_sfa9oi04bv_height_133_width_133.png&amp;quot;"></oppia-noninteractive-image><p>\n</p><p><span></span></p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><oppia-noninteractive-video autoplay-with-value="true" end-with-value="&amp;quot;&amp;quot;" start-with-value="&amp;quot;&amp;quot;" video_id-with-value="&amp;quot;OConyxG7HaM&amp;quot;"></oppia-noninteractive-video><p>\n</p><p><oppia-noninteractive-math raw_latex-with-value="&amp;quot;y=ax^4 + bx^3 + cx^2 + dx^1 + e&amp;quot;"></oppia-noninteractive-math></p><p>\n</p><p><oppia-noninteractive-link text-with-value="&amp;quot;Oppia&amp;quot;" url-with-value="&amp;quot;https://www.oppia.org&amp;quot;"></oppia-noninteractive-link><br>\n\xa0</p><p>\n</p><oppia-noninteractive-tabs tab_contents-with-value="[{&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 1&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 1&amp;quot;}, {&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 2&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 2&amp;quot;}]"></oppia-noninteractive-tabs><p>\n</p><p>\xa0</p><p>\n</p><pre>Hello World!</pre><p>\n</p><ol><li>\n</li><li>Item 1</li><li>\n</li><li>Item 2</li><li>\n</li><li>Item 3</li><li>\n</li><li>Item 4\n\t<ul><li>\n</li><li>Item a</li><li>\n</li><li>Item b</li><li>\n</li><li><strong>Item c</strong></li><li>\n</li><li><strong><em>Item d</em></strong></li><li>\n</li><li><strong><em>snsdjz</em></strong></li><li>\n</li></ul>\n</li><li>\n</li><li><strong><em>dsjfsfv</em></strong></li><li>\n</li></ol><p>\n</p><div>\xa0</div><p>\n</p>']}

```
 
Exploration Migration failing in testserver
Exploration migration manager job is failing in test server because of exploration validation check.

Few logs:
```
Invalid html: <p>That's not right. Try using the API Explorer (<oppia-noninteractive-link url-with-value=\"&amp;quot;https://developers.google.com/+/api/latest/activities/get#try-it&amp;quot;\"></oppia-noninteractive-link>).</p> due to errors in customization_args: {\"Missing attributes: [u'text-with-value'], Extra attributes: []\"

```

```
Invalid html: <p><oppia-noninteractive-link text-with-value="&amp;quot;oooo&amp;quot;" url-with-value="&amp;quot;www.oppia.org&amp;quot;"></oppia-noninteractive-link> jjjj</p> due to errors in customization
```

```
File "/<path>/core/domain/state_domain.py", line 1259, in validate
    'strings: %s' % (self.html, err_dict))
ValidationError: Invalid html: <p>\xa0</p><p>
</p><oppia-noninteractive-collapsible content-with-value="&amp;quot;&amp;lt;p&amp;gt;inner&amp;lt;/p&amp;gt;&amp;quot;" heading-with-value="&amp;quot;Title&amp;quot;"></oppia-noninteractive-collapsible><p>
</p><p>\xa0</p><p>
</p><p>Lorem ipsum Lorem ipsum</p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><oppia-noninteractive-image alt-with-value="&amp;quot;The oppia otter&amp;quot;" caption-with-value="&amp;quot;Otter&amp;quot;" filepath-with-value="&amp;quot;img_20180709_101312_sfa9oi04bv_height_133_width_133.png&amp;quot;"></oppia-noninteractive-image><p>
</p><p><span></span></p><p>
</p><p>\xa0</p><p>
</p><p>\xa0</p><p>
</p><oppia-noninteractive-video autoplay-with-value="true" end-with-value="&amp;quot;&amp;quot;" start-with-value="&amp;quot;&amp;quot;" video_id-with-value="&amp;quot;OConyxG7HaM&amp;quot;"></oppia-noninteractive-video><p>
</p><p><oppia-noninteractive-math raw_latex-with-value="&amp;quot;y=ax^4 + bx^3 + cx^2 + dx^1 + e&amp;quot;"></oppia-noninteractive-math></p><p>
</p><p><oppia-noninteractive-link text-with-value="&amp;quot;Oppia&amp;quot;" url-with-value="&amp;quot;https://www.oppia.org&amp;quot;"></oppia-noninteractive-link><br>
\xa0</p><p>
</p><oppia-noninteractive-tabs tab_contents-with-value="[{&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 1&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 1&amp;quot;}, {&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 2&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 2&amp;quot;}]"></oppia-noninteractive-tabs><p>
</p><p>\xa0</p><p>
</p><pre>Hello World!</pre><p>
</p><ol><li>
</li><li>Item 1</li><li>
</li><li>Item 2</li><li>
</li><li>Item 3</li><li>
</li><li>Item 4
	<ul><li>
</li><li>Item a</li><li>
</li><li>Item b</li><li>
</li><li><strong>Item c</strong></li><li>
</li><li><strong><em>Item d</em></strong></li><li>
</li><li><strong><em>snsdjz</em></strong></li><li>
</li></ul>
</li><li>
</li><li><strong><em>dsjfsfv</em></strong></li><li>
</li></ol><p>
</p><div>\xa0</div><p>
</p> for rte with invalid tags and strings: {'invalidTags': [u'div', u'span'], 'strings': [u'<p>\xa0</p><p>\n</p><oppia-noninteractive-collapsible content-with-value="&amp;quot;&amp;lt;p&amp;gt;inner&amp;lt;/p&amp;gt;&amp;quot;" heading-with-value="&amp;quot;Title&amp;quot;"></oppia-noninteractive-collapsible><p>\n</p><p>\xa0</p><p>\n</p><p>Lorem ipsum Lorem ipsum</p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><oppia-noninteractive-image alt-with-value="&amp;quot;The oppia otter&amp;quot;" caption-with-value="&amp;quot;Otter&amp;quot;" filepath-with-value="&amp;quot;img_20180709_101312_sfa9oi04bv_height_133_width_133.png&amp;quot;"></oppia-noninteractive-image><p>\n</p><p><span></span></p><p>\n</p><p>\xa0</p><p>\n</p><p>\xa0</p><p>\n</p><oppia-noninteractive-video autoplay-with-value="true" end-with-value="&amp;quot;&amp;quot;" start-with-value="&amp;quot;&amp;quot;" video_id-with-value="&amp;quot;OConyxG7HaM&amp;quot;"></oppia-noninteractive-video><p>\n</p><p><oppia-noninteractive-math raw_latex-with-value="&amp;quot;y=ax^4 + bx^3 + cx^2 + dx^1 + e&amp;quot;"></oppia-noninteractive-math></p><p>\n</p><p><oppia-noninteractive-link text-with-value="&amp;quot;Oppia&amp;quot;" url-with-value="&amp;quot;https://www.oppia.org&amp;quot;"></oppia-noninteractive-link><br>\n\xa0</p><p>\n</p><oppia-noninteractive-tabs tab_contents-with-value="[{&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 1&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 1&amp;quot;}, {&amp;quot;content&amp;quot;: &amp;quot;&amp;lt;p&amp;gt;contents 2&amp;lt;/p&amp;gt;&amp;quot;, &amp;quot;title&amp;quot;: &amp;quot;Title 2&amp;quot;}]"></oppia-noninteractive-tabs><p>\n</p><p>\xa0</p><p>\n</p><pre>Hello World!</pre><p>\n</p><ol><li>\n</li><li>Item 1</li><li>\n</li><li>Item 2</li><li>\n</li><li>Item 3</li><li>\n</li><li>Item 4\n\t<ul><li>\n</li><li>Item a</li><li>\n</li><li>Item b</li><li>\n</li><li><strong>Item c</strong></li><li>\n</li><li><strong><em>Item d</em></strong></li><li>\n</li><li><strong><em>snsdjz</em></strong></li><li>\n</li></ul>\n</li><li>\n</li><li><strong><em>dsjfsfv</em></strong></li><li>\n</li></ol><p>\n</p><div>\xa0</div><p>\n</p>']}

```
 


Discussion:
@NishealJ, Can you please check whether the 2nd error is happening because of [this](https://github.com/oppia/oppia/commit/58037800033cb64c703f6c4e01cefa73cc64d6e3#diff-781314b975a52120938e342ae5ffd787L253) change? 
Hi @DubeySandeep,

I'm not really sure about this but it looks like an issue with the Html validation, I'd like to learn more about this from @bansalnitish.  

Hi @bansalnitish, the above input contains `<div> & <span>` which is caught in the HTML validation, `<div>` & `<span>` tag are not expected in RTE right?  Also, there are many checks and tests for textangular output can I remove that? do we need it now in any place? they create confusion.

Also, I believe `span & div` tags should be caught by HTML validators, and I see them in the input.
please let me know if this is not the case Thanks!
Hi @NishealJ, Yes the textangular checks can be removed and the div and span tags are not expected in the rte html. The html was cleaned and passed validation during my GSoC and as of now we need to re-run the validation jobs, find out a root cause behind this issue and then re-run the migration jobs. I will take care of the textangular stuff removal after that, so please do not remove anything as of now. Thanks! (Me and @ankita240796 will be jointly looking into this issue)
sure @bansalnitish, I think it might need a lot of debugging.
Keep me updated I'd like to learn more about this Thanks! :)
@NishealJ, Can you please check whether the 2nd error is happening because of [this](https://github.com/oppia/oppia/commit/58037800033cb64c703f6c4e01cefa73cc64d6e3#diff-781314b975a52120938e342ae5ffd787L253) change? 
Hi @DubeySandeep,

I'm not really sure about this but it looks like an issue with the Html validation, I'd like to learn more about this from @bansalnitish.  

Hi @bansalnitish, the above input contains `<div> & <span>` which is caught in the HTML validation, `<div>` & `<span>` tag are not expected in RTE right?  Also, there are many checks and tests for textangular output can I remove that? do we need it now in any place? they create confusion.

Also, I believe `span & div` tags should be caught by HTML validators, and I see them in the input.
please let me know if this is not the case Thanks!
Hi @NishealJ, Yes the textangular checks can be removed and the div and span tags are not expected in the rte html. The html was cleaned and passed validation during my GSoC and as of now we need to re-run the validation jobs, find out a root cause behind this issue and then re-run the migration jobs. I will take care of the textangular stuff removal after that, so please do not remove anything as of now. Thanks! (Me and @ankita240796 will be jointly looking into this issue)
sure @bansalnitish, I think it might need a lot of debugging.
Keep me updated I'd like to learn more about this Thanks! :)

Resolving patch:
diff --git a/core/domain/question_domain.py b/core/domain/question_domain.py
--- a/core/domain/question_domain.py
+++ b/core/domain/question_domain.py
@@ -16,10 +16,11 @@
 
 """Domain objects relating to questions."""
 
+import datetime
+
 from constants import constants
 from core.domain import change_domain
 from core.domain import html_cleaner
-from core.domain import html_validation_service
 from core.domain import interaction_registry
 from core.domain import state_domain
 from core.platform import models
@@ -401,13 +402,7 @@ def __init__(
         """
         self.id = question_id
         self.creator_id = creator_id
-        # The initial clean up of html by converting it to ckeditor format
-        # is required since user may copy and paste some stuff in the rte
-        # which is not a valid ckeditor html string but can be converted
-        # to a valid ckeditor string without errors. This initial clean up
-        # ensures that validation will not fail in such cases.
-        self.question_content = html_validation_service.convert_to_ckeditor(
-            html_cleaner.clean(question_content))
+        self.question_content = html_cleaner.clean(question_content)
         self.created_on = question_model_created_on
         self.last_updated = question_model_last_updated
 
@@ -432,20 +427,29 @@ def validate(self):
             ValidationError: One or more attributes of question summary are
                 invalid.
         """
-        err_dict = html_validation_service.validate_rte_format(
-            [self.question_content], feconf.RTE_FORMAT_CKEDITOR)
-        for key in err_dict:
-            if err_dict[key]:
-                raise utils.ValidationError(
-                    'Invalid html: %s for rte with invalid tags and '
-                    'strings: %s' % (self.question_content, err_dict))
-
-        err_dict = html_validation_service.validate_customization_args([
-            self.question_content])
-        if err_dict:
+        if not isinstance(self.id, basestring):
+            raise utils.ValidationError(
+                'Expected id to be a string, received %s' % self.id)
+
+        if not isinstance(self.creator_id, basestring):
+            raise utils.ValidationError(
+                'Expected creator id to be a string, received %s' %
+                self.creator_id)
+
+        if not isinstance(self.question_content, basestring):
+            raise utils.ValidationError(
+                'Expected question content to be a string, received %s' %
+                self.question_content)
+
+        if not isinstance(self.created_on, datetime.datetime):
+            raise utils.ValidationError(
+                'Expected created on to be a datetime, received %s' %
+                self.created_on)
+
+        if not isinstance(self.last_updated, datetime.datetime):
             raise utils.ValidationError(
-                'Invalid html: %s due to errors in customization_args: %s' % (
-                    self.question_content, err_dict))
+                'Expected last updated to be a datetime, received %s' %
+                self.last_updated)
 
 
 class QuestionSkillLink(object):
diff --git a/core/domain/skill_domain.py b/core/domain/skill_domain.py
--- a/core/domain/skill_domain.py
+++ b/core/domain/skill_domain.py
@@ -17,7 +17,6 @@
 from constants import constants
 from core.domain import change_domain
 from core.domain import html_cleaner
-from core.domain import html_validation_service
 from core.domain import state_domain
 import feconf
 import utils
@@ -153,15 +152,8 @@ def __init__(
         """
         self.id = misconception_id
         self.name = name
-        # The initial clean up of html by converting it to ckeditor format
-        # is required since user may copy and paste some stuff in the rte
-        # which is not a valid ckeditor html string but can be converted
-        # to a valid ckeditor string without errors. This initial clean up
-        # ensures that validation will not fail in such cases.
-        self.notes = html_validation_service.convert_to_ckeditor(
-            html_cleaner.clean(notes))
-        self.feedback = html_validation_service.convert_to_ckeditor(
-            html_cleaner.clean(feedback))
+        self.notes = html_cleaner.clean(notes)
+        self.feedback = html_cleaner.clean(feedback)
 
     def to_dict(self):
         """Returns a dict representing this Misconception domain object.
@@ -208,32 +200,6 @@ def require_valid_misconception_id(cls, misconception_id):
                 'Expected misconception ID to be an integer, received %s' %
                 misconception_id)
 
-    @classmethod
-    def require_valid_html(cls, html):
-        """Validates that html passes sanitization and customization
-        args check.
-
-        Args:
-            html: str. The html string to be validated.
-
-        Raises:
-            ValidationError. The html string is invalid.
-        """
-        err_dict = html_validation_service.validate_rte_format(
-            [html], feconf.RTE_FORMAT_CKEDITOR)
-        for key in err_dict:
-            if err_dict[key]:
-                raise utils.ValidationError(
-                    'Invalid html: %s for rte with invalid tags and '
-                    'strings: %s' % (html, err_dict))
-
-        err_dict = html_validation_service.validate_customization_args([
-            html])
-        if err_dict:
-            raise utils.ValidationError(
-                'Invalid html: %s due to errors in customization_args: %s' % (
-                    html, err_dict))
-
     def validate(self):
         """Validates various properties of the Misconception object.
 
@@ -250,13 +216,11 @@ def validate(self):
             raise utils.ValidationError(
                 'Expected misconception notes to be a string, received %s' %
                 self.notes)
-        self.require_valid_html(self.notes)
 
         if not isinstance(self.feedback, basestring):
             raise utils.ValidationError(
                 'Expected misconception feedback to be a string, received %s' %
                 self.feedback)
-        self.require_valid_html(self.feedback)
 
 
 class SkillContents(object):
diff --git a/core/domain/state_domain.py b/core/domain/state_domain.py
--- a/core/domain/state_domain.py
+++ b/core/domain/state_domain.py
@@ -22,7 +22,6 @@
 from constants import constants
 from core.domain import customization_args_util
 from core.domain import html_cleaner
-from core.domain import html_validation_service
 from core.domain import interaction_registry
 from core.domain import param_domain
 import feconf
@@ -1200,13 +1199,7 @@ def __init__(self, content_id, html):
                 a way as to contain a restricted set of HTML tags.
         """
         self.content_id = content_id
-        # The initial clean up of html by converting it to ckeditor format
-        # is required since user may copy and paste some stuff in the rte
-        # which is not a valid ckeditor html string but can be converted
-        # to a valid ckeditor string without errors. This initial clean up
-        # ensures that validation will not fail in such cases.
-        self.html = html_validation_service.convert_to_ckeditor(
-            html_cleaner.clean(html))
+        self.html = html_cleaner.clean(html)
         self.validate()
 
     def to_dict(self):
@@ -1250,21 +1243,6 @@ def validate(self):
             raise utils.ValidationError(
                 'Invalid content HTML: %s' % self.html)
 
-        err_dict = html_validation_service.validate_rte_format(
-            [self.html], feconf.RTE_FORMAT_CKEDITOR)
-        for key in err_dict:
-            if err_dict[key]:
-                raise utils.ValidationError(
-                    'Invalid html: %s for rte with invalid tags and '
-                    'strings: %s' % (self.html, err_dict))
-
-        err_dict = html_validation_service.validate_customization_args([
-            self.html])
-        if err_dict:
-            raise utils.ValidationError(
-                'Invalid html: %s due to errors in customization_args: %s' % (
-                    self.html, err_dict))
-
     @classmethod
     def create_default_subtitled_html(cls, content_id):
         """Create a default SubtitledHtml domain object."""


Test patch:
diff --git a/core/domain/question_domain_test.py b/core/domain/question_domain_test.py
--- a/core/domain/question_domain_test.py
+++ b/core/domain/question_domain_test.py
@@ -472,34 +472,38 @@ def test_to_dict(self):
     def test_validation_with_valid_properties(self):
         self.observed_object.validate()
 
-    def test_validation_with_invalid_html_in_question_content(self):
-        """Test validation fails with invalid html in question
-        content.
-        """
-        self.observed_object.question_content = '<a>Test</a>'
+    def test_validation_with_invalid_id(self):
+        self.observed_object.id = 1
         with self.assertRaisesRegexp(
-            utils.ValidationError, (
-                'Invalid html: <a>Test</a> for rte with invalid tags and '
-                'strings: {\'invalidTags\': \\[u\'a\'], '
-                '\'strings\': \\[\'<a>Test</a>\']}')):
+            utils.ValidationError, 'Expected id to be a string, received 1'):
             self.observed_object.validate()
 
-    def test_validation_with_invalid_customization_args_in_question_content(
-            self):
-        """Test validation fails with invalid customization args in question
-        content.
-        """
-        self.observed_object.question_content = (
-            '<oppia-noninteractive-image></oppia-noninteractive-image>')
+    def test_validation_with_invalid_creator_id(self):
+        self.observed_object.creator_id = 1
         with self.assertRaisesRegexp(
-            utils.ValidationError, (
-                'Invalid html: <oppia-noninteractive-image>'
-                '</oppia-noninteractive-image> due to errors in '
-                'customization_args: {"Missing attributes: '
-                '\\[u\'alt-with-value\', u\'caption-with-value\', '
-                'u\'filepath-with-value\'], Extra attributes: \\[]": '
-                '\\[\'<oppia-noninteractive-image>'
-                '</oppia-noninteractive-image>\']}')):
+            utils.ValidationError,
+            'Expected creator id to be a string, received 1'):
+            self.observed_object.validate()
+
+    def test_validation_with_invalid_question_content(self):
+        self.observed_object.question_content = 1
+        with self.assertRaisesRegexp(
+            utils.ValidationError,
+            'Expected question content to be a string, received 1'):
+            self.observed_object.validate()
+
+    def test_validation_with_invalid_created_on(self):
+        self.observed_object.created_on = 1
+        with self.assertRaisesRegexp(
+            utils.ValidationError,
+            'Expected created on to be a datetime, received 1'):
+            self.observed_object.validate()
+
+    def test_validation_with_invalid_last_updated(self):
+        self.observed_object.last_updated = 1
+        with self.assertRaisesRegexp(
+            utils.ValidationError,
+            'Expected last updated to be a datetime, received 1'):
             self.observed_object.validate()
 
 
diff --git a/core/domain/skill_domain_test.py b/core/domain/skill_domain_test.py
--- a/core/domain/skill_domain_test.py
+++ b/core/domain/skill_domain_test.py
@@ -121,45 +121,6 @@ def test_misconception_validation(self):
         self.skill.misconceptions = ''
         self._assert_validation_error('Expected misconceptions to be a list')
 
-    def test_misconception_validation_with_invalid_html_in_notes(self):
-        self.skill.misconceptions[0].notes = '<a>Test</a>'
-        self._assert_validation_error(
-            'Invalid html: <a>Test</a> for rte with invalid tags and '
-            'strings: {\'invalidTags\': \\[u\'a\'], '
-            '\'strings\': \\[\'<a>Test</a>\']}')
-
-    def test_misconception_validation_with_invalid_customization_args_in_notes(
-            self):
-        self.skill.misconceptions[0].notes = (
-            '<oppia-noninteractive-image></oppia-noninteractive-image>')
-        self._assert_validation_error(
-            'Invalid html: <oppia-noninteractive-image>'
-            '</oppia-noninteractive-image> due to errors in '
-            'customization_args: {"Missing attributes: '
-            '\\[u\'alt-with-value\', u\'caption-with-value\', '
-            'u\'filepath-with-value\'], Extra attributes: \\[]": '
-            '\\[\'<oppia-noninteractive-image>'
-            '</oppia-noninteractive-image>\']}')
-
-    def test_misconception_validation_with_invalid_html_in_feedback(self):
-        self.skill.misconceptions[0].feedback = '<a>Test</a>'
-        self._assert_validation_error(
-            'Invalid html: <a>Test</a> for rte with invalid tags and '
-            'strings: {\'invalidTags\': \\[u\'a\'], '
-            '\'strings\': \\[\'<a>Test</a>\']}')
-
-    def test_misconception_validation_with_invalid_customization_args_in_feedback(self): # pylint: disable=line-too-long
-        self.skill.misconceptions[0].feedback = (
-            '<oppia-noninteractive-image></oppia-noninteractive-image>')
-        self._assert_validation_error(
-            'Invalid html: <oppia-noninteractive-image>'
-            '</oppia-noninteractive-image> due to errors in '
-            'customization_args: {"Missing attributes: '
-            '\\[u\'alt-with-value\', u\'caption-with-value\', '
-            'u\'filepath-with-value\'], Extra attributes: \\[]": '
-            '\\[\'<oppia-noninteractive-image>'
-            '</oppia-noninteractive-image>\']}')
-
     def test_skill_contents_validation(self):
         self.skill.skill_contents.worked_examples = ''
         self._assert_validation_error('Expected worked examples to be a list')
diff --git a/core/domain/state_domain_test.py b/core/domain/state_domain_test.py
--- a/core/domain/state_domain_test.py
+++ b/core/domain/state_domain_test.py
@@ -407,40 +407,6 @@ def test_subtitled_html_validation_with_invalid_html_type(self):
             with self.swap(subtitled_html, 'html', 20):
                 subtitled_html.validate()
 
-    def test_subtitled_html_validation_with_invalid_html_for_rte(self):
-        """Test validation of subtitled HTML with invalid html for rte."""
-        subtitled_html = state_domain.SubtitledHtml(
-            'content_id', '<p>some html</p>')
-        subtitled_html.validate()
-
-        with self.assertRaisesRegexp(
-            utils.ValidationError, (
-                'Invalid html: <a>Test</a> for rte with invalid tags and '
-                'strings: {\'invalidTags\': \\[u\'a\'], '
-                '\'strings\': \\[\'<a>Test</a>\']}')):
-            with self.swap(subtitled_html, 'html', '<a>Test</a>'):
-                subtitled_html.validate()
-
-    def test_subtitled_html_validation_with_invalid_customization_args(self):
-        """Test validation of subtitled HTML with invalid customization args."""
-        subtitled_html = state_domain.SubtitledHtml(
-            'content_id', '<p>some html</p>')
-        subtitled_html.validate()
-
-        with self.assertRaisesRegexp(
-            utils.ValidationError, (
-                'Invalid html: <oppia-noninteractive-image>'
-                '</oppia-noninteractive-image> due to errors in '
-                'customization_args: {"Missing attributes: '
-                '\\[u\'alt-with-value\', u\'caption-with-value\', '
-                'u\'filepath-with-value\'], Extra attributes: \\[]": '
-                '\\[\'<oppia-noninteractive-image>'
-                '</oppia-noninteractive-image>\']}')):
-            with self.swap(
-                subtitled_html, 'html',
-                '<oppia-noninteractive-image></oppia-noninteractive-image>'):
-                subtitled_html.validate()
-
     def test_subtitled_html_validation_with_invalid_content(self):
         """Test validation of subtitled HTML with invalid content."""
         subtitled_html = state_domain.SubtitledHtml(