Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Started adding unit tests to Aristotle

  • Loading branch information...
commit 6db9ad3679c2c2b91113e007114aa586e002e5a5 1 parent 6b34ee2
@jermnelson authored
View
5 aristotle/apps/datasets/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
16 aristotle/apps/discovery/tests.py
@@ -0,0 +1,16 @@
+"""
+ :mods:`tests` Unit tests for discovery functionality in Aristotle
+"""
+__author__ = 'Jeremy Nelson'
+import unittest
+from django.test.client import Client
+
+class TestSearch(unittest.TestCase):
+
+ def setUp(self):
+ self.client = Client()
+
+
+ def test_default(self):
+ response = c.get('/')
+ self.assertEquals(response.status_code,'200')
View
10 aristotle/apps/grx/tests.py
@@ -4,12 +4,12 @@
(c) 2011 Colorado College
"""
__author__ = 'Jeremy Nelson'
-import grx.settings as grx
-from django.test import TestCase
-from grx.bots.grxbots import GoldRushBot
-from grx.bots.solrbots import SolrBot
+import settings as grx
+import unittest
+from bots.grxbots import GoldRushBot
+from bots.solrbots import SolrBot
-class SetupTest(TestCase):
+class SetupTest(unittest.TestCase):
def setUp(self):
# Default bots used in this app
View
4 aristotle/apps/marc/bots/tests.py
@@ -13,7 +13,7 @@
def validate300b(raw_string):
- good_300b = '%s, %s' % ('digital',digital_re.sub('',raw_string)
+ good_300b = '%s, %s' % ('digital',digital_re.sub('',raw_string))
last_char = good_300b[-1]
if last_char == '+':
if good_300b[-3] == ',':
@@ -23,6 +23,6 @@ def validate300b(raw_string):
elif last_char == ',':
good_300b = good_300b[:-1]
if good_300b[-1] != '.':
- good_300b = good_300b += '.'
+ good_300b += '.'
return good_300b
View
5 aristotle/apps/marc/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
5 aristotle/apps/repository/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
5 aristotle/apps/schema_org/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
5 aristotle/apps/vendors/ebsco/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
9 aristotle/apps/vendors/iii/tests.py
@@ -4,13 +4,12 @@
Replace this with more appropriate tests for your application.
"""
+import unittest
+from settings import *
-from django.test import TestCase
-from vendors.iii.settings import *
-
-class ConfigurationTest(TestCase):
+class ConfigurationTest(unittest.TestCase):
def test_opac_settings(self):
self.assertEquals(OPAC_URL,
- 'http://tiger.coloradocollege.edu')
+ 'http://tiger.coloradocollege.edu/xrecord=')
View
5 aristotle/apps/vendors/oclc/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
5 aristotle/apps/vendors/refworks/tests.py
@@ -5,10 +5,9 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
4 aristotle/apps/vendors/tests.py
@@ -5,10 +5,10 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
4 aristotle/apps/vendors/whitewhale/tests.py
@@ -5,10 +5,10 @@
Replace this with more appropriate tests for your application.
"""
-from django.test import TestCase
+import unittest
-class SimpleTest(TestCase):
+class SimpleTest(unittest.TestCase):
def test_basic_addition(self):
"""
Tests that 1 + 1 always equals 2.
View
33 aristotle/templates/404.html
@@ -0,0 +1,33 @@
+{% extends 'cc-search-base.html' %}
+
+{% block search-title %}Tutt Library Discovery Services 404 Page Not Found • Colorado College{% endblock %}
+
+{% block more-css %}
+{% endblock %}
+
+{% block search-panel %}
+{% endblock %}
+
+{% block search-facets %}
+{% endblock %}
+
+{% block results-detail %}
+{% endblock %}
+
+{% block results-list %}
+<div class="main">
+<div class="results-list discovery-service">
+<h1>Sorry! 404 Error</h1>
+<div class="discovery-home">
+ <h2 class="discovery-home">Please contact the library if you continue to have pproblems</h2>
+<p> We couldn't find this resource
+ </p>
+ <span class="clear"></span>
+</div>
+</div>
+</div>
+<span class="clear"></span>
+{% endblock %}
+
+{% block more-scripts %}
+{% endblock more-scripts %}
View
42 aristotle/tests/test_notification_templates.py
@@ -1,42 +0,0 @@
-from notification.models import NoticeType, get_formatted_messages
-
-FORMATS = [
- 'short.txt',
- 'full.txt',
- 'notice.html',
- 'full.html',
-]
-
-class MockDict:
- def __contains__(self, key):
- return True
-
- def __getitem__(self, key):
- return "{{%s}}" % key
-
- def __setitem__(self, key, value):
- pass
-
- def update(self, e, **f):
- pass
-
- def pop(self):
- pass
-
-MOCK_CONTEXT = MockDict()
-
-def run():
-
- for notice_type in NoticeType.objects.all():
- label = notice_type.label
- print "-" * 72
- print "testing %s..." % label
- try:
- messages = get_formatted_messages(FORMATS, label, MOCK_CONTEXT)
- except Exception, e:
- print e
- for format in FORMATS:
- print "%s:" % format
- print messages[format]
- print
-
Please sign in to comment.
Something went wrong with that request. Please try again.