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

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ShawnMilo committed Aug 21, 2015
1 parent 0dd83a9 commit 13ca41c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion learningresources/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,4 +251,3 @@ def get_preview_url(resource, org=None, course_number=None, run=None):
key=key,
)
)

5 changes: 3 additions & 2 deletions rest/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
LearningResource,
StaticAsset,
LearningResourceType,
STATIC_ASSET_BASEPATH
STATIC_ASSET_BASEPATH,
get_preview_url as resource_preview_url,
)


Expand Down Expand Up @@ -244,7 +245,7 @@ def validate_terms(self, terms):
@staticmethod
def get_preview_url(obj):
"""Construct preview URL for LearningResource."""
return obj.get_preview_url()
return resource_preview_url(obj)


class StaticAssetSerializer(ModelSerializer):
Expand Down
5 changes: 3 additions & 2 deletions rest/tests/test_learning_resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
LearningResource,
LearningResourceType,
Repository,
get_preview_url,
)
from importer.tasks import import_file
from taxonomy.models import Vocabulary
Expand Down Expand Up @@ -263,7 +264,7 @@ def test_preview_url(self):
)
self.assertEqual(
expected_jump_to_id_url,
learning_resource.get_preview_url()
get_preview_url(learning_resource)
)

resource_dict = self.get_learning_resource(
Expand All @@ -275,7 +276,7 @@ def test_preview_url(self):
self.assertEqual(
"https://www.sandbox.edx.org/courses/"
"test-org/infinity/Febtober/courseware",
learning_resource.get_preview_url()
get_preview_url(learning_resource)
)

def test_learning_resource_exports_invalid_methods(self):
Expand Down

0 comments on commit 13ca41c

Please sign in to comment.