
from django.conf import settings
from django.test import TestCase
from django.db.models import connection

from boardinghouse.models import Schema

class TestRejectSchemaColumnChange(TestCase):
    def test_exception_is_raised(self):
        Schema.objects.mass_create('a')
        cursor = connection.cursor()
        UPDATE = "UPDATE boardinghouse_schema SET schema='foo' WHERE schema='a'"
        self.assertRaises(Exception, cursor.execute, UPDATE)        

from django.conf import settings
from django.test import TestCase
from django.db import connection

from boardinghouse.models import Schema

class TestRejectSchemaColumnChange(TestCase):
    def test_exception_is_raised(self):
        Schema.objects.mass_create('a')
        cursor = connection.cursor()
        UPDATE = "UPDATE boardinghouse_schema SET schema='foo' WHERE schema='a'"
        self.assertRaises(Exception, cursor.execute, UPDATE)
Make test work with 1.7
Make test work with 1.7

  
  from django.conf import settings
  from django.test import TestCase
- from django.db.models import connection
+ from django.db import connection
  
  from boardinghouse.models import Schema
  
  class TestRejectSchemaColumnChange(TestCase):
      def test_exception_is_raised(self):
          Schema.objects.mass_create('a')
          cursor = connection.cursor()
          UPDATE = "UPDATE boardinghouse_schema SET schema='foo' WHERE schema='a'"
-         self.assertRaises(Exception, cursor.execute, UPDATE)        
+         self.assertRaises(Exception, cursor.execute, UPDATE)
Make test work with 1.7
## Code Before:

from django.conf import settings
from django.test import TestCase
from django.db.models import connection

from boardinghouse.models import Schema

class TestRejectSchemaColumnChange(TestCase):
    def test_exception_is_raised(self):
        Schema.objects.mass_create('a')
        cursor = connection.cursor()
        UPDATE = "UPDATE boardinghouse_schema SET schema='foo' WHERE schema='a'"
        self.assertRaises(Exception, cursor.execute, UPDATE)        
## Instruction:
Make test work with 1.7
## Code After:

from django.conf import settings
from django.test import TestCase
from django.db import connection

from boardinghouse.models import Schema

class TestRejectSchemaColumnChange(TestCase):
    def test_exception_is_raised(self):
        Schema.objects.mass_create('a')
        cursor = connection.cursor()
        UPDATE = "UPDATE boardinghouse_schema SET schema='foo' WHERE schema='a'"
        self.assertRaises(Exception, cursor.execute, UPDATE)