Commit 11181a64 authored by Tushar Bhatia's avatar Tushar Bhatia Committed by Tim Graham
Browse files

Fixed #22979 -- Moved bug* tests

parent f14898a4
Loading
Loading
Loading
Loading
+0 −0

File moved.

+2 −2
Original line number Diff line number Diff line
@@ -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()

tests/bug639/models.py

deleted100644 → 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