Commit 985c6f64 by Ned Batchelder

Fix the inheritance of tests into tests for the recommender tests

parent 4234ff59
...@@ -224,13 +224,10 @@ class TestRecommenderCreateFromEmpty(TestRecommender): ...@@ -224,13 +224,10 @@ class TestRecommenderCreateFromEmpty(TestRecommender):
@attr('shard_1') @attr('shard_1')
class TestRecommenderWithResources(TestRecommender): class TestRecommenderResourceBase(TestRecommender):
""" """Base helper class for tests with resources."""
Check whether we can add/edit/flag/export resources correctly
"""
def setUp(self): def setUp(self):
# call the setUp function from the superclass super(TestRecommenderResourceBase, self).setUp()
super(TestRecommenderWithResources, self).setUp()
self.resource_id = self.resource_urls[0] self.resource_id = self.resource_urls[0]
self.resource_id_second = self.resource_urls[1] self.resource_id_second = self.resource_urls[1]
self.non_existing_resource_id = 'An non-existing id' self.non_existing_resource_id = 'An non-existing id'
...@@ -258,6 +255,12 @@ class TestRecommenderWithResources(TestRecommender): ...@@ -258,6 +255,12 @@ class TestRecommenderWithResources(TestRecommender):
resource.update(edited_recommendations) resource.update(edited_recommendations)
return resource return resource
@attr('shard_1')
class TestRecommenderWithResources(TestRecommenderResourceBase):
"""
Check whether we can add/edit/flag/export resources correctly
"""
def test_add_redundant_resource(self): def test_add_redundant_resource(self):
""" """
Verify the addition of a redundant resource (url) is rejected Verify the addition of a redundant resource (url) is rejected
...@@ -420,14 +423,10 @@ class TestRecommenderWithResources(TestRecommender): ...@@ -420,14 +423,10 @@ class TestRecommenderWithResources(TestRecommender):
@attr('shard_1') @attr('shard_1')
@ddt @ddt
class TestRecommenderVoteWithResources(TestRecommenderWithResources): class TestRecommenderVoteWithResources(TestRecommenderResourceBase):
""" """
Check whether we can vote resources correctly Check whether we can vote resources correctly
""" """
def setUp(self):
# call the setUp function from the superclass
super(TestRecommenderVoteWithResources, self).setUp()
@data( @data(
{'event': 'recommender_upvote'}, {'event': 'recommender_upvote'},
{'event': 'recommender_downvote'} {'event': 'recommender_downvote'}
...@@ -538,14 +537,10 @@ class TestRecommenderVoteWithResources(TestRecommenderWithResources): ...@@ -538,14 +537,10 @@ class TestRecommenderVoteWithResources(TestRecommenderWithResources):
@attr('shard_1') @attr('shard_1')
@ddt @ddt
class TestRecommenderStaffFeedbackWithResources(TestRecommenderWithResources): class TestRecommenderStaffFeedbackWithResources(TestRecommenderResourceBase):
""" """
Check whether we can remove/endorse resources correctly Check whether we can remove/endorse resources correctly
""" """
def setUp(self):
# call the setUp function from the superclass
super(TestRecommenderStaffFeedbackWithResources, self).setUp()
@data('remove_resource', 'endorse_resource') @data('remove_resource', 'endorse_resource')
def test_remove_or_endorse_resource_non_existing(self, test_case): def test_remove_or_endorse_resource_non_existing(self, test_case):
""" """
...@@ -642,7 +637,6 @@ class TestRecommenderFileUploading(TestRecommender): ...@@ -642,7 +637,6 @@ class TestRecommenderFileUploading(TestRecommender):
Check whether we can handle file uploading correctly Check whether we can handle file uploading correctly
""" """
def setUp(self): def setUp(self):
# call the setUp function from the superclass
super(TestRecommenderFileUploading, self).setUp() super(TestRecommenderFileUploading, self).setUp()
self.initial_configuration = { self.initial_configuration = {
'flagged_accum_resources': {}, 'flagged_accum_resources': {},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment