Commit b274c2e2 by Piotr Mitros

Added basic test case

--HG--
branch : pmitros-mod-template
parent cbc02078
...@@ -34,5 +34,16 @@ for module in modx_module_list: ...@@ -34,5 +34,16 @@ for module in modx_module_list:
modx_modules[tag] = module.Module modx_modules[tag] = module.Module
def get_module_class(tag): def get_module_class(tag):
''' Given an XML tag (e.g. 'video'), return
the associated module (e.g. video_module.Module).
'''
return modx_modules[tag] return modx_modules[tag]
def get_module_id(tag):
''' Given an XML tag (e.g. 'video'), return
the default ID for that module (e.g. 'youtube_id')
'''
return modx_modules[tag].id_attribute
def get_valid_tags():
return modx_modules.keys()
""" import unittest
This file demonstrates writing tests using the unittest module. These will pass import courseware.modules
when you run "manage.py test".
Replace this with more appropriate tests for your application. class ModelsTest(unittest.TestCase):
""" def setUp(self):
pass
from django.test import TestCase def test_get_module_class(self):
vc = courseware.modules.get_module_class('video')
vc_str = "<class 'courseware.modules.video_module.Module'>"
self.assertEqual(str(vc), vc_str)
class SimpleTest(TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
"""
self.assertEqual(1 + 1, 2)
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