Avoiding an initialization problem by setting NOMCOM_PUBLIC_KEYS_DIR in settings_sqlitetest. This is not the best long term fix

- Legacy-Id: 10581
This commit is contained in:
Robert Sparks 2015-12-11 17:30:13 +00:00
parent 6574618cdf
commit ea6d82846f
3 changed files with 6 additions and 4 deletions

View file

@ -84,7 +84,7 @@ class NomComFactory(factory.DjangoModelFactory):
group = factory.SubFactory(GroupFactory,type_id='nomcom')
public_key = factory.django.FileField(data=cert,storage=FileSystemStorage(location=settings.NOMCOM_PUBLIC_KEYS_DIR))
public_key = factory.django.FileField(data=cert)
@factory.post_generation
def populate_positions(self, create, extracted, **kwargs):

View file

@ -1116,7 +1116,7 @@ class FeedbackLastSeenTests(TestCase):
def setUp(self):
build_test_public_keys_dir(self)
self.nc = NomComFactory.create(**nomcom_kwargs_for_year(group__state_id='conclude'))
self.nc = NomComFactory.create(**nomcom_kwargs_for_year())
self.author = PersonFactory.create().email_set.first().address
self.member = self.nc.group.role_set.filter(name='member').first().person
self.nominee = self.nc.nominee_set.first()
@ -1187,7 +1187,7 @@ class NewActiveNomComTests(TestCase):
def setUp(self):
build_test_public_keys_dir(self)
self.nc = NomComFactory.create(**nomcom_kwargs_for_year(group__state_id='conclude'))
self.nc = NomComFactory.create(**nomcom_kwargs_for_year())
self.chair = self.nc.group.role_set.filter(name='chair').first().person
def tearDown(self):

View file

@ -5,6 +5,7 @@
# ./manage.py test --settings=settings_sqlitetest doc.ChangeStateTestCase
#
import io
from settings import * # pyflakes:ignore
# Workaround to avoid spending minutes stepping through the migrations in
@ -38,4 +39,5 @@ DATABASES = {
if TEST_CODE_COVERAGE_CHECKER and not TEST_CODE_COVERAGE_CHECKER._started:
TEST_CODE_COVERAGE_CHECKER.start()
NOMCOM_PUBLIC_KEYS_DIR=os.path.abspath("tmp-nomcom-public-keys-dir")