diff --git a/euscanwww/djeuscan/tests/test_charts.py b/euscanwww/djeuscan/tests/test_charts.py index 65239aa..e50dd8b 100644 --- a/euscanwww/djeuscan/tests/test_charts.py +++ b/euscanwww/djeuscan/tests/test_charts.py @@ -99,4 +99,4 @@ class MaintainerChartTests(ChartTests): def setUp(self): super(MaintainerChartTests, self).setUp() self.url = "chart_maintainer" - self.kwargs = {"maintainer_id": MaintainerFactory.create().id} + self.kwargs = {"maintainer_id": MaintainerFactory.create().pk} diff --git a/euscanwww/djeuscan/tests/test_views.py b/euscanwww/djeuscan/tests/test_views.py index 20222c9..5cf55c2 100644 --- a/euscanwww/djeuscan/tests/test_views.py +++ b/euscanwww/djeuscan/tests/test_views.py @@ -92,7 +92,8 @@ class SectionTests(SystemTestCase): soup = BeautifulSoup(response.content) rows = soup.findAll("tr") - self.assertEqual(len(rows), len(items)) + # the -1 is for the table heading + self.assertEqual(len(rows) - 1, len(items)) for item in items: if attr: diff --git a/euscanwww/djeuscan/views.py b/euscanwww/djeuscan/views.py index 5f16a43..05c8c21 100644 --- a/euscanwww/djeuscan/views.py +++ b/euscanwww/djeuscan/views.py @@ -128,6 +128,7 @@ def get_maintainer_or_404(id=None, email=None): else: return get_object_or_404(Maintainer, email=email) + @render_to('euscan/maintainer.html') def maintainer(request, maintainer_id=None, maintainer_email=None): maintainer = get_maintainer_or_404(maintainer_id, maintainer_email) @@ -567,7 +568,7 @@ def favourite_maintainer(request, maintainer_id=None, maintainer_email=None): @ajax_request def unfavourite_maintainer(request, maintainer_id=None, maintainer_email=None): obj = get_maintainer_or_404(maintainer_id, maintainer_email) - get_profile(request.user).maintainers.remove(maintainer) + get_profile(request.user).maintainers.remove(obj) return {"success": True}