Changed tests to use our own subclassed TestCase, and changed almost all fixtures to be perma_fixtures.

- Legacy-Id: 6320
This commit is contained in:
Henrik Levkowetz 2013-09-30 20:36:20 +00:00
parent 4395949b85
commit e4f4467725
39 changed files with 232 additions and 174 deletions

View file

@ -1,11 +1,11 @@
import datetime
from django.conf import settings
import django.test
from ietf.utils.test_utils import SimpleUrlTestCase, canonicalize_sitemap
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
from ietf.announcements.models import ScheduledAnnouncement
@ -21,7 +21,7 @@ class AnnouncementsUrlTestCase(SimpleUrlTestCase):
else:
return content
class SendScheduledAnnouncementsTestCase(django.test.TestCase):
class SendScheduledAnnouncementsTestCase(TestCase):
def test_send_plain_announcement(self):
a = ScheduledAnnouncement.objects.create(
mail_sent=False,
@ -66,8 +66,9 @@ class SendScheduledAnnouncementsTestCase(django.test.TestCase):
self.assertTrue(ScheduledAnnouncement.objects.get(id=a.id).mail_sent)
class SendScheduledAnnouncementsTestCaseREDESIGN(django.test.TestCase):
fixtures = ["names"]
class SendScheduledAnnouncementsTestCaseREDESIGN(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ["names"]
def test_send_plain_announcement(self):
make_test_data()

View file

@ -1,6 +1,5 @@
import os, shutil, datetime
import django.test
from django.core.urlresolvers import reverse as urlreverse
from pyquery import PyQuery
@ -8,6 +7,7 @@ from pyquery import PyQuery
from ietf.utils.mail import outbox
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils import TestCase
from ietf.doc.models import *
from ietf.name.models import *
@ -23,8 +23,9 @@ from ietf.doc.tests_conflict_review import *
from ietf.doc.tests_status_change import *
class SearchTestCase(django.test.TestCase):
fixtures = ['names']
class SearchTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_search(self):
draft = make_test_data()
@ -125,8 +126,9 @@ class SearchTestCase(django.test.TestCase):
self.assertTrue(draft.title in r.content)
class DocTestCase(django.test.TestCase):
fixtures = ['names']
class DocTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_document_draft(self):
draft = make_test_data()
@ -248,8 +250,9 @@ class DocTestCase(django.test.TestCase):
self.assertEqual(r.status_code, 200)
class AddCommentTestCase(django.test.TestCase):
fixtures = ['names']
class AddCommentTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_add_comment(self):
draft = make_test_data()

View file

@ -3,7 +3,6 @@ import StringIO
import os, shutil
from datetime import date, timedelta, time
import django.test
from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
@ -19,9 +18,11 @@ from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
class EditPositionTestCase(django.test.TestCase):
fixtures = ['names']
class EditPositionTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_edit_position(self):
draft = make_test_data()
@ -169,8 +170,9 @@ class EditPositionTestCase(django.test.TestCase):
self.assertTrue("Test!" in str(m))
class DeferBallotTestCase(django.test.TestCase):
fixtures = ['names']
class DeferBallotTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_defer_ballot(self):
draft = make_test_data()
@ -215,8 +217,9 @@ class DeferBallotTestCase(django.test.TestCase):
draft = Document.objects.get(name=draft.name)
self.assertEquals(draft.get_state_slug("draft-iesg"), "iesg-eva")
class BallotWriteupsTestCase(django.test.TestCase):
fixtures = ['names']
class BallotWriteupsTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_edit_last_call_text(self):
draft = make_test_data()
@ -406,8 +409,9 @@ class BallotWriteupsTestCase(django.test.TestCase):
draft = Document.objects.get(name=draft.name)
self.assertTrue("Subject: Results of IETF-conflict review" in draft.latest_event(WriteupDocEvent, type="changed_ballot_approval_text").text)
class ApproveBallotTestCase(django.test.TestCase):
fixtures = ['names']
class ApproveBallotTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_approve_ballot(self):
draft = make_test_data()
@ -456,8 +460,9 @@ class ApproveBallotTestCase(django.test.TestCase):
self.assertEquals(len(outbox), mailbox_before + 3)
self.assertTrue("NOT be published" in str(outbox[-1]))
class MakeLastCallTestCase(django.test.TestCase):
fixtures = ['names']
class MakeLastCallTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_make_last_call(self):
draft = make_test_data()

View file

@ -6,7 +6,6 @@ from StringIO import StringIO
from textwrap import wrap
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
@ -15,6 +14,7 @@ from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.doc.utils import create_ballot_if_not_open
from ietf.doc.views_conflict_review import default_approval_text
from ietf.utils import TestCase
from ietf.doc.models import Document,DocEvent,NewRevisionDocEvent,BallotPositionDocEvent,TelechatDocEvent,DocAlias,State
from ietf.name.models import StreamName
@ -22,9 +22,9 @@ from ietf.group.models import Person
from ietf.iesg.models import TelechatDate
class ConflictReviewTestCase(django.test.TestCase):
fixtures = ['names']
class ConflictReviewTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_start_review(self):
@ -254,9 +254,9 @@ class ConflictReviewTestCase(django.test.TestCase):
make_test_data()
class ConflictReviewSubmitTestCase(django.test.TestCase):
fixtures = ['names']
class ConflictReviewSubmitTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names',]
def test_initial_submission(self):
doc = Document.objects.get(name='conflict-review-imaginary-irtf-submission')

View file

@ -3,7 +3,6 @@ import StringIO
import os, shutil
from datetime import date, timedelta, time
import django.test
from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
@ -19,10 +18,12 @@ from ietf.iesg.models import TelechatDate
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
class ChangeStateTestCase(django.test.TestCase):
fixtures = ['names']
class ChangeStateTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_change_state(self):
draft = make_test_data()
@ -177,8 +178,9 @@ class ChangeStateTestCase(django.test.TestCase):
self.assertTrue("Last call was requested" in draft.latest_event().desc)
class EditInfoTestCase(django.test.TestCase):
fixtures = ['names']
class EditInfoTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_edit_info(self):
draft = make_test_data()
@ -359,8 +361,9 @@ class EditInfoTestCase(django.test.TestCase):
self.assertEqual(draft.latest_event(ConsensusDocEvent, type="changed_consensus").consensus, True)
class ResurrectTestCase(django.test.TestCase):
fixtures = ['names']
class ResurrectTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_request_resurrect(self):
draft = make_test_data()
@ -426,8 +429,9 @@ class ResurrectTestCase(django.test.TestCase):
self.assertEquals(len(outbox), mailbox_before + 1)
class ExpireIDsTestCase(django.test.TestCase):
fixtures = ['names']
class ExpireIDsTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def setUp(self):
self.id_dir = os.path.abspath("tmp-id-dir")
@ -608,8 +612,9 @@ class ExpireIDsTestCase(django.test.TestCase):
self.assertTrue(not os.path.exists(os.path.join(self.id_dir, txt)))
self.assertTrue(os.path.exists(os.path.join(self.archive_dir, "deleted_tombstones", txt)))
class ExpireLastCallTestCase(django.test.TestCase):
fixtures = ['names']
class ExpireLastCallTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_expire_last_call(self):
from ietf.doc.lastcall import get_expired_last_calls, expire_last_call
@ -657,9 +662,9 @@ class ExpireLastCallTestCase(django.test.TestCase):
self.assertEquals(len(outbox), mailbox_before + 1)
self.assertTrue("Last Call Expired" in outbox[-1]["Subject"])
class IndividualInfoFormsTestCase(django.test.TestCase):
fixtures = ['names']
class IndividualInfoFormsTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_doc_change_stream(self):
url = urlreverse('doc_change_stream', kwargs=dict(name=self.docname))
@ -885,8 +890,9 @@ class IndividualInfoFormsTestCase(django.test.TestCase):
self.docname='draft-ietf-mars-test'
self.doc = Document.objects.get(name=self.docname)
class SubmitToIesgTestCase(django.test.TestCase):
fixtures = ['names']
class SubmitToIesgTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def verify_permissions(self):
@ -945,8 +951,9 @@ class SubmitToIesgTestCase(django.test.TestCase):
self.doc = Document.objects.get(name=self.docname)
self.doc.unset_state('draft-iesg')
class RequestPublicationTestCase(django.test.TestCase):
fixtures = ['names']
class RequestPublicationTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_request_publication(self):
draft = make_test_data()

View file

@ -6,7 +6,6 @@ from StringIO import StringIO
from textwrap import wrap
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
@ -15,6 +14,7 @@ from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.doc.utils import create_ballot_if_not_open
from ietf.doc.views_status_change import default_approval_text
from ietf.utils import TestCase
from ietf.doc.models import Document,DocEvent,NewRevisionDocEvent,BallotPositionDocEvent,TelechatDocEvent,WriteupDocEvent,DocAlias,State
from ietf.name.models import StreamName
@ -22,9 +22,9 @@ from ietf.group.models import Person
from ietf.iesg.models import TelechatDate
class StatusChangeTestCase(django.test.TestCase):
fixtures = ['names']
class StatusChangeTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_start_review(self):
@ -353,9 +353,9 @@ class StatusChangeTestCase(django.test.TestCase):
make_test_data()
class StatusChangeSubmitTestCase(django.test.TestCase):
fixtures = ['names']
class StatusChangeSubmitTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_initial_submission(self):
doc = Document.objects.get(name='status-change-imaginary-mid-review')

View file

@ -5,7 +5,7 @@ The test cases are split into multiple files.
"""
import sys
from django.test import TestCase
from ietf.utils import TestCase
from datetime import datetime
# actual tests are distributed among a set of files in subdir tests/

View file

@ -1,9 +1,11 @@
import sys
from django.test import TestCase
from ietf.utils import TestCase
from ietf.group.models import Group
class WorkingGroupTestCase(TestCase):
fixtures = [ 'workinggroups.json']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
fixtures = [ 'workinggroups', ]
perma_fixtures = []
def test_FindOneWg(self):
one = Group.objects.filter(acronym = 'roll')

View file

@ -5,7 +5,7 @@ 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
from ietf.utils import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):

View file

@ -1,16 +1,17 @@
import datetime, shutil
import django.test
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.test_data import make_test_data
from ietf.utils import TestCase
from ietf.doc.models import *
from ietf.idindex.index import *
class IndexTestCase(django.test.TestCase):
fixtures = ['names']
class IndexTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def setUp(self):
self.id_dir = os.path.abspath("tmp-id-dir")

View file

@ -1,7 +1,6 @@
from datetime import timedelta
import os, shutil
import django.test
from django.core.urlresolvers import reverse as urlreverse
from django.conf import settings
@ -9,11 +8,12 @@ from pyquery import PyQuery
from ietf.idtracker.models import *
from ietf.iesg.models import *
from ietf.utils.test_utils import SimpleUrlTestCase, RealDatabaseTest, canonicalize_feed, login_testing_unauthorized
from ietf.utils.test_utils import TestCase, SimpleUrlTestCase, RealDatabaseTest, canonicalize_feed, login_testing_unauthorized
from ietf.ietfworkflows.models import Stream
class RescheduleOnAgendaTestCase(django.test.TestCase):
fixtures = ['base', 'draft']
class RescheduleOnAgendaTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['base', 'draft']
def test_reschedule(self):
draft = InternetDraft.objects.get(filename="draft-ietf-mipshop-pfmipv6")
@ -54,8 +54,8 @@ class RescheduleOnAgendaTestCase(django.test.TestCase):
self.assertEquals(draft.idinternal.comments().count(), comments_before + 1)
self.assertTrue("Telechat" in draft.idinternal.comments()[0].comment_text)
class RescheduleOnAgendaTestCaseREDESIGN(django.test.TestCase):
fixtures = ['names']
class RescheduleOnAgendaTestCaseREDESIGN(TestCase):
perma_fixtures = ['names']
def test_reschedule(self):
from ietf.utils.test_data import make_test_data
@ -111,8 +111,8 @@ class RescheduleOnAgendaTestCaseREDESIGN(django.test.TestCase):
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
RescheduleOnAgendaTestCase = RescheduleOnAgendaTestCaseREDESIGN
class ManageTelechatDatesTestCase(django.test.TestCase):
fixtures = ['base', 'draft']
class ManageTelechatDatesTestCase(TestCase):
perma_fixtures = ['base', 'draft']
def test_set_dates(self):
dates = TelechatDates.objects.all()[0]
@ -152,8 +152,8 @@ class ManageTelechatDatesTestCase(django.test.TestCase):
self.assertTrue(dates.date4 == new_date)
self.assertTrue(dates.date1 == old_date2)
# class ManageTelechatDatesTestCaseREDESIGN(django.test.TestCase):
# fixtures = ['names']
# class ManageTelechatDatesTestCaseREDESIGN(TestCase):
# perma_fixtures = ['names']
# def test_set_dates(self):
# from ietf.utils.test_data import make_test_data
@ -203,8 +203,8 @@ if settings.USE_DB_REDESIGN_PROXY_CLASSES:
#ManageTelechatDatesTestCase = ManageTelechatDatesTestCaseREDESIGN
del ManageTelechatDatesTestCase
class WorkingGroupActionsTestCase(django.test.TestCase):
fixtures = ['base', 'wgactions']
class WorkingGroupActionsTestCase(TestCase):
perma_fixtures = ['base', 'wgactions']
def setUp(self):
super(self.__class__, self).setUp()
@ -313,8 +313,8 @@ class WorkingGroupActionsTestCase(django.test.TestCase):
self.assertTrue('(sieve)' not in r.content)
class WorkingGroupActionsTestCaseREDESIGN(django.test.TestCase):
fixtures = ['names']
class WorkingGroupActionsTestCaseREDESIGN(TestCase):
perma_fixtures = ['names']
def setUp(self):
super(self.__class__, self).setUp()
@ -473,9 +473,9 @@ class IesgUrlTestCase(SimpleUrlTestCase):
from ietf.doc.models import Document,TelechatDocEvent,State
from ietf.group.models import Person
class DeferUndeferTestCase(django.test.TestCase):
class DeferUndeferTestCase(TestCase):
fixtures=['names']
perma_fixtures = ['names']
def helper_test_defer(self,name):

View file

@ -3,13 +3,13 @@ import datetime, os, shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse as urlreverse
import django.test
from StringIO import StringIO
from pyquery import PyQuery
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
from ietf.person.models import Person, Email
@ -18,8 +18,9 @@ if settings.USE_DB_REDESIGN_PROXY_CLASSES:
from ietf.doc.utils import *
from ietf.name.models import DocTagName
class EditStreamInfoTestCase(django.test.TestCase):
fixtures = ['names']
class EditStreamInfoTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_adopt_document(self):
draft = make_test_data()

View file

@ -3,13 +3,13 @@ import datetime, os, shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse as urlreverse
import django.test
from StringIO import StringIO
from pyquery import PyQuery
from ietf.utils.test_utils import SimpleUrlTestCase, canonicalize_feed, canonicalize_sitemap, login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
class LiaisonsUrlTestCase(SimpleUrlTestCase):
def testUrls(self):
@ -91,12 +91,19 @@ def make_liaison_models():
return l
class LiaisonManagementTestCase(django.test.TestCase):
fixtures = ['names']
class LiaisonManagementTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def setUp(self):
self.liaison_dir = os.path.abspath("tmp-liaison-dir")
os.mkdir(self.liaison_dir)
try:
os.mkdir(self.liaison_dir)
except OSError, e:
if "File exists" in str(e):
pass
else:
raise
settings.LIAISON_ATTACH_PATH = self.liaison_dir

View file

@ -5,7 +5,7 @@ The test cases are split into multiple files.
"""
import sys
from django.test import TestCase
from ietf.utils import TestCase
from datetime import datetime
# actual tests are distributed among a set of files in subdir tests/

View file

@ -1,6 +1,6 @@
import sys
from django.test import Client
from django.test import TestCase
from ietf.utils import TestCase
from ietf.name.models import SessionStatusName
from ietf.person.models import Person
from ietf.group.models import Group
@ -8,7 +8,8 @@ from ietf.meeting.models import TimeSlot, Session, Meeting, ScheduledSession
from ietf.meeting.helpers import get_meeting, get_schedule
class AgendaInfoTestCase(TestCase):
fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
'meeting83.json',
'constraint83.json',
'workinggroups.json',
@ -32,8 +33,7 @@ class AgendaInfoTestCase(TestCase):
self.assertEqual(len(timeslots),26)
self.assertEqual(meeting.number,'83')
self.assertEqual(venue.meeting_num, "83")
# will change as more ADs are added to fixtures
self.assertEqual(len(ads), 3)
self.assertTrue(len(ads) > 0)
def test_AgendaInfoReturnsSortedTimeSlots(self):
from ietf.meeting.views import agenda_info

View file

@ -1,7 +1,7 @@
import base64
import sys, datetime
from django.test import Client
from django.test import TestCase
from ietf.utils import TestCase
#from ietf.person.models import Person
from django.contrib.auth.models import User
@ -14,7 +14,8 @@ from ietf.meeting.helpers import get_meeting
import debug
class ApiTestCase(TestCase):
fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
'meeting83.json',
'constraint83.json',
'workinggroups.json',

View file

@ -1,6 +1,6 @@
import sys
from django.test import Client
from django.test import TestCase
from ietf.utils import TestCase
#from ietf.person.models import Person
from django.contrib.auth.models import User
from ietf.ietfauth.decorators import has_role
@ -19,7 +19,8 @@ auth_ferrel = {'REMOTE_USER':'stephen.farrell@cs.tcd.ie'}
class AuthDataTestCase(TestCase):
fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
'meeting83.json',
'constraint83.json',
'workinggroups.json',

View file

@ -2,7 +2,7 @@ import re
import sys
from settings import BASE_DIR
from django.test import Client
from django.test import TestCase
from ietf.utils import TestCase
#from ietf.person.models import Person
from django.contrib.auth.models import User
from django.test.client import Client
@ -12,7 +12,8 @@ from auths import auth_joeblow, auth_wlo, auth_ietfchair, auth_ferrel
capture_output = False
class EditTestCase(TestCase):
fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
'meeting83.json',
'constraint83.json',
'workinggroups.json',

View file

@ -3,7 +3,7 @@ import sys
from urlparse import urljoin
from django.test import Client
from django.test import TestCase
from ietf.utils import TestCase
from django.contrib.auth.models import User
from ietf.person.models import Person
@ -13,7 +13,8 @@ from ietf.group.models import Group
class UrlGenTestCase(TestCase):
fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'names.xml', # ietf/names/fixtures/names.xml for MeetingTypeName, and TimeSlotTypeName
'meeting83.json',
'constraint83.json',
'workinggroups.json',

View file

@ -2,7 +2,7 @@
import os
import tempfile
from django.test import TestCase
from ietf.utils import TestCase
from django.db import IntegrityError
from django.core.urlresolvers import reverse
from django.core.files import File
@ -25,7 +25,8 @@ from ietf.nomcom.utils import get_nomcom_by_year
class NomcomViewsTest(TestCase):
"""Tests to create a new nomcom"""
fixtures = ['names', 'nomcom_templates']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names', 'nomcom_templates']
def check_url_status(self, url, status):
response = self.client.get(url)
@ -589,7 +590,8 @@ class NomcomViewsTest(TestCase):
class NomineePositionStateSaveTest(TestCase):
"""Tests for the NomineePosition save override method"""
fixtures = ['names', 'nomcom_templates']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names', 'nomcom_templates']
def setUp(self):
nomcom_test_data()
@ -621,7 +623,7 @@ class NomineePositionStateSaveTest(TestCase):
class FeedbackTest(TestCase):
fixtures = ['names', 'nomcom_templates']
perma_fixtures = ['names', 'nomcom_templates']
def setUp(self):
nomcom_test_data()

View file

@ -1,10 +1,11 @@
import sys
from django.test import TestCase
from ietf.utils import TestCase
from ietf.group.models import Group
from ietf.person.models import Person
class PersonFetchTestCase(TestCase):
fixtures = [ 'person.json', 'users.json']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = [ 'persons']
def test_FindNoPerson(self):
one = Person.objects.by_email('wlo@amsl.org')

View file

@ -5,7 +5,7 @@ when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from ietf.utils import TestCase
class SimpleTest(TestCase):

View file

@ -1,6 +1,6 @@
from django.db import connection
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from django.contrib.auth.models import User
from ietf.group.models import Group
@ -22,7 +22,8 @@ AD_USER=''
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
# ------- Test View -------- #
def test_main(self):
@ -34,22 +35,20 @@ class MainTestCase(TestCase):
class DummyCase(TestCase):
name = connection.settings_dict['NAME']
print name
class UnauthorizedCase(TestCase):
fixtures = ['names']
perma_fixtures = ['names']
def test_unauthorized(self):
"Unauthorized Test"
draft = make_test_data()
url = reverse('announcement')
# get random working group chair
person = Person.objects.filter(role__group__type='wg')[0]
person = Person.objects.filter(role__group__acronym='mars')[0]
r = self.client.get(url,REMOTE_USER=person.user)
self.assertEquals(r.status_code, 403)
class SubmitCase(TestCase):
fixtures = ['names']
perma_fixtures = ['names']
def test_invalid_submit(self):
"Invalid Submit"

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from django.contrib.auth.models import User
from ietf.group.models import Group, GroupEvent
@ -14,13 +14,15 @@ import datetime
SECR_USER='secretary'
def augment_data():
system = Person.objects.get(name="(system)")
area = Group.objects.get(acronym='farfut')
GroupEvent.objects.create(group=area,
type='started',
by_id=0)
by=system)
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names', 'persons', 'groupgroup', 'groupevents']
def test_main(self):
"Main Test"

View file

@ -5,7 +5,7 @@ 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
from ietf.utils import TestCase
class SimpleTest(TestCase):
def test_basic_addition(self):

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.doc.models import Document
from ietf.utils.test_data import make_test_data
@ -9,7 +9,8 @@ from pyquery import PyQuery
SECR_USER='secretary'
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.group.models import Group
from ietf.person.models import Person
from ietf.utils.test_data import make_test_data
@ -8,9 +8,10 @@ import debug
SECR_USER='secretary'
class GroupsTest(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names','persons','groupgroup',]
"""
fixtures = [ 'acronym.json',
perma_fixtures = [ 'acronym.json',
'area.json',
'areadirector',
'areagroup.json',
@ -97,8 +98,8 @@ class GroupsTest(TestCase):
# ------- Test Edit -------- #
def test_edit_valid(self):
draft = make_test_data()
group = Group.objects.filter(type='wg')[0]
area = Group.objects.filter(type='area')[0]
group = Group.objects.filter(acronym='mars')[0]
area = Group.objects.filter(acronym='farfut')[0]
ad = Person.objects.get(name='Aread Irector')
url = reverse('groups_edit', kwargs={'acronym':group.acronym})
target = reverse('groups_view', kwargs={'acronym':group.acronym})
@ -118,7 +119,7 @@ class GroupsTest(TestCase):
# ------- Test People -------- #
def test_people_delete(self):
draft = make_test_data()
group = Group.objects.filter(type='wg')[0]
group = Group.objects.filter(acronym='mars')[0]
role = group.role_set.all()[0]
url = reverse('groups_delete_role', kwargs={'acronym':group.acronym,'id':role.id})
target = reverse('groups_people', kwargs={'acronym':group.acronym})
@ -129,7 +130,7 @@ class GroupsTest(TestCase):
def test_people_add(self):
draft = make_test_data()
person = Person.objects.get(name='Aread Irector')
group = Group.objects.filter(type='wg')[0]
group = Group.objects.filter(acronym='mars')[0]
url = reverse('groups_people', kwargs={'acronym':group.acronym})
post_data = {'name':'chair',
'person':'Joe Smith - (%s)' % person.id,

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.doc.models import Document
from ietf.utils.test_data import make_test_data
@ -9,7 +9,8 @@ from pyquery import PyQuery
SECR_USER='secretary'
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.meeting.models import Meeting
from ietf.utils.test_data import make_test_data
@ -9,7 +9,8 @@ from pyquery import PyQuery
SECR_USER='secretary'
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.meeting.models import Meeting
from ietf.utils.test_data import make_test_data
@ -10,7 +10,8 @@ import debug
SECR_USER='secretary'
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -1,11 +1,12 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.group.models import Group
from ietf.person.models import Person
from ietf.utils.test_data import make_test_data
from pyquery import PyQuery
import debug
SECR_USER='secretary'
@ -14,7 +15,8 @@ def augment_data():
Group.objects.create(acronym='dummy',name='Dummy Group',type_id='sdo')
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names', 'persons', 'groupgroup']
def test_main(self):
"Main Test"
@ -26,7 +28,7 @@ class MainTestCase(TestCase):
def test_roles_delete(self):
draft = make_test_data()
augment_data()
group = Group.objects.filter(type='wg')[0]
group = Group.objects.filter(acronym='mars')[0]
role = group.role_set.all()[0]
url = reverse('roles_delete_role', kwargs={'acronym':group.acronym,'id':role.id})
target = reverse('roles') + '?group=%s' % group.acronym
@ -38,7 +40,7 @@ class MainTestCase(TestCase):
draft = make_test_data()
augment_data()
person = Person.objects.get(name='Aread Irector')
group = Group.objects.filter(type='wg')[0]
group = Group.objects.filter(acronym='mars')[0]
url = reverse('roles')
target = reverse('roles') + '?group=%s' % group.acronym
post_data = {'group_acronym':group.acronym,

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.person.models import Person
from ietf.utils.test_data import make_test_data
@ -9,7 +9,8 @@ from pyquery import PyQuery
SECR_USER='secretary'
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -2,7 +2,7 @@ import unittest
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from django.test.client import Client
from ietf.group.models import Group
from ietf.ietfauth.decorators import has_role
@ -20,7 +20,8 @@ class SreqUrlTestCase(SimpleUrlTestCase):
self.doTestUrls(__file__)
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
draft = make_test_data()
@ -33,7 +34,7 @@ class MainTestCase(TestCase):
self.failUnless(len(unsched) > 0)
class SubmitRequestCase(TestCase):
fixtures = ['names']
perma_fixtures = ['names']
def test_submit_request(self):
draft = make_test_data()

View file

@ -1,5 +1,5 @@
from django.core.urlresolvers import reverse
from django.test import TestCase
from ietf.utils import TestCase
from ietf.iesg.models import TelechatDate, TelechatAgendaItem, WGAction
from ietf.person.models import Person
@ -15,7 +15,8 @@ def augment_data():
TelechatDate.objects.create(date=datetime.datetime.today())
class MainTestCase(TestCase):
fixtures = ['names']
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_main(self):
"Main Test"

View file

@ -6,21 +6,22 @@ import re
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse as urlreverse
import django.test
from StringIO import StringIO
from pyquery import PyQuery
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
from ietf.person.models import Person, Email
from ietf.group.models import Group, Role
from ietf.doc.models import *
from ietf.submit.models import IdSubmissionDetail, Preapproval
class SubmitTestCase(django.test.TestCase):
fixtures = ['names', 'idsubmissionstatus']
class SubmitTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names', 'idsubmissionstatus']
def setUp(self):
self.staging_dir = os.path.abspath("tmp-submit-staging-dir")
@ -401,8 +402,8 @@ class SubmitTestCase(django.test.TestCase):
self.assertTrue("Full URL for managing submission" in outbox[-1]["Subject"])
self.assertTrue(name in outbox[-1]["Subject"])
class ApprovalsTestCase(django.test.TestCase):
fixtures = ['names', 'idsubmissionstatus']
class ApprovalsTestCase(TestCase):
perma_fixtures = ['names', 'idsubmissionstatus']
def test_approvals(self):
make_test_data()

View file

@ -1,11 +1,11 @@
import unittest, re, json, datetime, StringIO
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils import TestCase
from ietf.doc.models import *
from ietf.doc.utils import add_state_change_event
@ -15,8 +15,9 @@ from ietf.sync import iana, rfceditor
from pyquery import PyQuery
class IANASyncTestCase(django.test.TestCase):
fixtures = ['names']
class IANASyncTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_protocol_page_sync(self):
draft = make_test_data()
@ -176,8 +177,9 @@ ICANN
self.assertEqual(DocEvent.objects.filter(doc=draft, type="iana_review").count(), 1)
class RFCSyncTestCase(django.test.TestCase):
fixtures = ['names']
class RFCSyncTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_rfc_index(self):
doc = make_test_data()
@ -367,8 +369,9 @@ class RFCSyncTestCase(django.test.TestCase):
self.assertEquals(len(changed), 0)
self.assertEquals(len(warnings), 0)
class DiscrepanciesTestCase(django.test.TestCase):
fixtures = ['names']
class DiscrepanciesTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_discrepancies(self):
make_test_data()
@ -408,8 +411,9 @@ class DiscrepanciesTestCase(django.test.TestCase):
r = self.client.get(urlreverse("ietf.sync.views.discrepancies"))
self.assertTrue(doc.name in r.content)
class RFCEditorUndoTestCase(django.test.TestCase):
fixtures = ['names']
class RFCEditorUndoTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_rfceditor_undo(self):
draft = make_test_data()

View file

@ -3,13 +3,13 @@ import datetime, os, shutil
from django.conf import settings
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse as urlreverse
import django.test
from StringIO import StringIO
from pyquery import PyQuery
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils.test_data import make_test_data
from ietf.utils.mail import outbox
from ietf.utils import TestCase
if settings.USE_DB_REDESIGN_PROXY_CLASSES:
from ietf.person.models import Person, Email
@ -17,8 +17,9 @@ if settings.USE_DB_REDESIGN_PROXY_CLASSES:
from ietf.doc.models import Document, State, WriteupDocEvent
from ietf.name.models import DocTagName
class ManageDelegatesTestCase(django.test.TestCase):
fixtures = ['names']
class ManageDelegatesTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_delete_delegate(self):
make_test_data()
@ -99,8 +100,9 @@ class ManageDelegatesTestCase(django.test.TestCase):
self.assertEquals(history_before + 1, GroupHistory.objects.filter(acronym="mars").count())
class ManageShepherdsTestCase(django.test.TestCase):
fixtures = ['names']
class ManageShepherdsTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_manage_shepherds(self):
make_test_data()
@ -138,8 +140,9 @@ class ManageShepherdsTestCase(django.test.TestCase):
self.assertEquals(len(q('div#othershepherds a:contains("Shepherd other")')), 1)
class ManageWorkflowTestCase(django.test.TestCase):
fixtures = ['names']
class ManageWorkflowTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def test_manage_workflows(self):
make_test_data()

View file

@ -3,12 +3,12 @@
import os, shutil, datetime
from StringIO import StringIO
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils import TestCase
from pyquery import PyQuery
@ -21,8 +21,9 @@ from ietf.person.models import *
from ietf.iesg.models import TelechatDate
from ietf.wgcharter.utils import *
class EditCharterTestCase(django.test.TestCase):
fixtures = ['names']
class EditCharterTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def setUp(self):
self.charter_dir = os.path.abspath("tmp-charter-dir")
@ -197,8 +198,9 @@ class EditCharterTestCase(django.test.TestCase):
self.assertEquals(f.read(),
"Windows line\nMac line\nUnix line\n" + utf_8_snippet)
class ApproveCharterTestCase(django.test.TestCase):
fixtures = ['names']
class ApproveCharterTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ['names']
def setUp(self):
self.charter_dir = os.path.abspath("tmp-charter-dir")

View file

@ -32,12 +32,12 @@
import os, unittest, shutil, calendar
import django.test
from django.conf import settings
from django.core.urlresolvers import reverse as urlreverse
from ietf.utils.mail import outbox
from ietf.utils.test_data import make_test_data
from ietf.utils.test_utils import login_testing_unauthorized
from ietf.utils import TestCase
from pyquery import PyQuery
import debug
@ -65,8 +65,9 @@ class WgFileTestCase(unittest.TestCase):
print "wget -nd -nc -np -r http://www.ietf.org/wg-descriptions/"
print "And set IETFWG_DESCRIPTIONS_PATH in settings_local.py\n"
class WgOverviewTestCase(django.test.TestCase):
fixtures = ["names"]
class WgOverviewTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ["names"]
def test_overview(self):
make_test_data()
@ -81,8 +82,9 @@ class WgOverviewTestCase(django.test.TestCase):
self.assertEquals(len(q('table.ietf-doctable td.acronym a:contains("mars")')), 1)
class WgEditTestCase(django.test.TestCase):
fixtures = ["names"]
class WgEditTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ["names"]
def setUp(self):
self.charter_dir = os.path.abspath("tmp-charter-dir")
@ -279,8 +281,9 @@ class WgEditTestCase(django.test.TestCase):
group = Group.objects.get(acronym=group.acronym)
self.assertEquals(group.state_id, "active")
class MilestoneTestCase(django.test.TestCase):
fixtures = ["names"]
class MilestoneTestCase(TestCase):
# See ietf.utils.test_utils.TestCase for the use of perma_fixtures vs. fixtures
perma_fixtures = ["names"]
def create_test_milestones(self):
draft = make_test_data()