old_contents: """
  This file demonstrates two different styles of tests (one doctest and one
  unittest). These will both pass when you run "manage.py test".
  
  Replace these with more appropriate tests for your application.
  """
  
  from django.test import TestCase
  
  class SimpleTest(TestCase):
      def test_basic_addition(self):
          """
          Tests that 1 + 1 always equals 2.
          """
          self.failUnlessEqual(1 + 1, 2)
  
  __test__ = {"doctest": """
  Another way to test that 1 + 1 is equal to 2.
  
  >>> 1 + 1 == 2
  True
  """}
  
  
new_contents: """
      Training tests.
  """
  import os
  import re
  import shutil
  from django.test import TestCase
  from django.test.client import Client
  from django.contrib.auth.models import User
  from django.conf import settings
  from django.utils import simplejson
  
  
  TESTFILE = "simple.png"
  
  
  class TrainingTest(TestCase):
      fixtures = ["ocrmodels/fixtures/test_fixtures.json",
              "projects/fixtures/test_fixtures.json"]
  
      def setUp(self):
          """
              Setup OCR tests.  Creates a test user.
          """
          #shutil.copy2("media/models/mytessdata.tgz", "media/test/engtessdata.tgz")
          #shutil.copy2("media/models/default.model", "media/test/default.model")
          #shutil.copy2("media/models/default.fst", "media/test/default.fst")
          #os.makedirs("media/files/test_user/test")
          #shutil.copy2("media/test/%s" % TESTFILE, "media/files/test_user/test/%s" % TESTFILE)
          self.testuser = User.objects.create_user("test_user", "test@testing.com", "testpass")
          self.client = Client()
          self.client.login(username="test_user", password="testpass")
          self.client.get("/projects/load/1/")
  
  
      def tearDown(self):
          """
              Cleanup a test.
          """
          self.testuser.delete()
          #shutil.rmtree("media/files/test_user")
  
      def test_new_view(self):
          """
          Test viewing the training submission form.
          """
          r = self.client.get("/training/new/")
          self.assertEqual(r.status_code, 200)
  
  
      def test_list_view(self):
          """
          Test viewing the training set list.
          """
          r = self.client.get("/training/list/")
          self.assertEqual(r.status_code, 200)
  
  
      def test_comparisons_view(self):
          """
          Test viewing the comparisons list.
          """
          r = self.client.get("/training/comparisons/")
          self.assertEqual(r.status_code, 200)
  
  
  
  
subject: Add some very basic training app tests. Not testing anything hard yet.