from django.db import models
from django.core.exceptions import ImproperlyConfigured
from django.test import TestCase

from ..models import ModelAdmin2
from ..core import Admin2


class Thing(models.Model):
    pass


class Admin2Test(TestCase):
    def setUp(self):
        self.admin2 = Admin2()

    def test_register(self):
        self.admin2.register(Thing)
        self.assertTrue(isinstance(self.admin2.registry[Thing], ModelAdmin2))

    def test_register_error(self):
        self.admin2.register(Thing)
        self.assertRaises(ImproperlyConfigured, self.admin2.register, Thing)

    def test_deregister(self):
        self.admin2.register(Thing)
        self.admin2.deregister(Thing)
        self.assertTrue(Thing not in self.admin2.registry)

    def test_deregister_error(self):
        self.assertRaises(ImproperlyConfigured, self.admin2.deregister, Thing)

    def test_get_urls(self):
        self.admin2.register(Thing)
        self.assertEquals(4, len(self.admin2.get_urls()))

@@ -1,997 +1,45 @@
-from django.db import models%0Afrom django.core.exceptions import ImproperlyConfigured%0Afrom django.test import TestCase%0A%0Afrom ..models import ModelAdmin2%0Afrom ..core import Admin2%0A%0A%0Aclass Thing(models.Model):%0A    pass%0A%0A%0Aclass Admin2Test(TestCase):%0A    def setUp(self):%0A        self.admin2 = Admin2()%0A%0A    def test_register(self):%0A        self.admin2.register(Thing)%0A        self.assertTrue(isinstance(self.admin2.registry%5BThing%5D, ModelAdmin2))%0A%0A    def test_register_error(self):%0A        self.admin2.register(Thing)%0A        self.assertRaises(ImproperlyConfigured, self.admin2.register, Thing)%0A%0A    def test_deregister(self):%0A        self.admin2.register(Thing)%0A        self.admin2.deregister(Thing)%0A        self.assertTrue(Thing not in self.admin2.registry)%0A%0A    def test_deregister_error(self):%0A        self.assertRaises(ImproperlyConfigured, self.admin2.deregister, Thing)%0A%0A    def test_get_urls(self):%0A        self.admin2.register(Thing)%0A        self.assertEquals(4, len(self.admin2.get_urls()))%0A
+# This is just a stub file. Write moar tests!

test cleanup