Skip to content
This repository has been archived by the owner on Jan 28, 2020. It is now read-only.

Commit

Permalink
Remove text field from serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
George Schneeloch committed Sep 4, 2015
1 parent c48da3e commit 3459b82
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
1 change: 0 additions & 1 deletion rest/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ class LearningResourceExportTaskSerializer(Serializer):

class RepositorySearchSerializer(Serializer):
"""Serializer for search metadata."""
text = CharField()
resource_type = CharField()
course = CharField()
run = CharField()
Expand Down
20 changes: 0 additions & 20 deletions rest/tests/test_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from __future__ import unicode_literals

from six.moves import urllib_parse
from lxml import etree

from rest_framework.status import (
HTTP_200_OK,
Expand Down Expand Up @@ -50,24 +49,6 @@ def get_results(self, query="", selected_facets=None):

def assert_result_equal(self, result, resource):
"""Helper method to assert result == resource."""
def make_text(obj):
"""Format result.text"""
try:
# Strip XML tags from content before indexing.
tree = etree.fromstring(obj.content_xml)
content = etree.tostring(tree, encoding="utf-8", method="text")
except etree.XMLSyntaxError:
# For blank/invalid XML.
content = obj.content_xml
try:
content = content.decode('utf-8')
except AttributeError:
# For Python 3.
pass

return "{0} {1} {2}".format(
obj.title, obj.description, content
)

self.assertEqual(
{
Expand All @@ -81,7 +62,6 @@ def make_text(obj):
'xa_nr_views': resource.xa_nr_views,
'preview_url': get_preview_url(resource),
'run': resource.course.run,
'text': make_text(resource),
'title': resource.title
},
result
Expand Down

0 comments on commit 3459b82

Please sign in to comment.