示例#1
0
	def test_Allow2tagsBlock1tag(self):
		tagless = strip_tags('<p>hello</p><a>Goodbye</a><c>Goodbye</c>', '<p><a>')

		self.assertEqual(tagless, '<p>hello</p><a>Goodbye</a>Goodbye')
示例#2
0
	def test_twoStringAllowOtherTags(self):
		tagless = strip_tags('<p>hello</p><a>Goodbye</a>', '<a>')

		self.assertEqual(tagless, 'hello<a>Goodbye</a>')
示例#3
0
	def test_StringAllowableTags(self):
		tagless = strip_tags('<p>hello</p>', '<p>')

		self.assertEqual(tagless, '<p>hello</p>')
示例#4
0
	def test_twoStringInsideTags(self):
		tagless = strip_tags('<p>hello</p><a>Goodbye</a>')

		self.assertEqual(tagless, 'helloGoodbye')
示例#5
0
	def test_StringInsideTags(self):
		tagless = strip_tags('<p>hello</p>')

		self.assertEqual(tagless, 'hello')
示例#6
0
	def test_StringWithNoTags(self):
		tagless = strip_tags('hello')

		self.assertEqual(tagless, 'hello')