Loading tests/bug639/__init__.py→tests/admin_autodiscover/__init__.py +0 −0 File moved. tests/bug8245/admin.py→tests/admin_autodiscover/admin.py +0 −0 File moved. View file tests/bug8245/models.py→tests/admin_autodiscover/models.py +0 −0 File moved. View file tests/bug8245/tests.py→tests/admin_autodiscover/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ from unittest import TestCase from django.contrib import admin class Bug8245Test(TestCase): class AdminAutoDiscoverTests(TestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_bug_8245(self): def test_double_call_autodiscover(self): # The first time autodiscover is called, we should get our real error. with self.assertRaises(Exception) as cm: admin.autodiscover() Loading tests/bug639/models.pydeleted 100644 → 0 +0 −31 Original line number Diff line number Diff line import os import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.forms import ModelForm temp_storage_dir = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']) temp_storage = FileSystemStorage(temp_storage_dir) class Photo(models.Model): title = models.CharField(max_length=30) image = models.FileField(storage=temp_storage, upload_to='tests') # Support code for the tests; this keeps track of how many times save() # gets called on each instance. def __init__(self, *args, **kwargs): super(Photo, self).__init__(*args, **kwargs) self._savecount = 0 def save(self, force_insert=False, force_update=False): super(Photo, self).save(force_insert, force_update) self._savecount += 1 class PhotoForm(ModelForm): class Meta: model = Photo fields = '__all__' Loading
tests/bug8245/tests.py→tests/admin_autodiscover/tests.py +2 −2 Original line number Diff line number Diff line Loading @@ -3,12 +3,12 @@ from unittest import TestCase from django.contrib import admin class Bug8245Test(TestCase): class AdminAutoDiscoverTests(TestCase): """ Test for bug #8245 - don't raise an AlreadyRegistered exception when using autodiscover() and an admin.py module contains an error. """ def test_bug_8245(self): def test_double_call_autodiscover(self): # The first time autodiscover is called, we should get our real error. with self.assertRaises(Exception) as cm: admin.autodiscover() Loading
tests/bug639/models.pydeleted 100644 → 0 +0 −31 Original line number Diff line number Diff line import os import tempfile from django.core.files.storage import FileSystemStorage from django.db import models from django.forms import ModelForm temp_storage_dir = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']) temp_storage = FileSystemStorage(temp_storage_dir) class Photo(models.Model): title = models.CharField(max_length=30) image = models.FileField(storage=temp_storage, upload_to='tests') # Support code for the tests; this keeps track of how many times save() # gets called on each instance. def __init__(self, *args, **kwargs): super(Photo, self).__init__(*args, **kwargs) self._savecount = 0 def save(self, force_insert=False, force_update=False): super(Photo, self).save(force_insert, force_update) self._savecount += 1 class PhotoForm(ModelForm): class Meta: model = Photo fields = '__all__'