Document 'cavesnew' option in databasereset.py - which just reads in

caves datafiles.
This commit is contained in:
wookey 2013-10-07 23:45:59 +01:00
parent 6b84d811a2
commit 4d6f8cb079
3 changed files with 14 additions and 32 deletions

View File

@ -167,12 +167,14 @@ def usage():
where command is:
reset - this is normal usage, clear database and reread everything
desc
cavesnew - read in the caves
logbooks - read in the logbooks
autologbooks
dumplogbooks
people
QMs - read in the QM files
resetend
scans - reaq in the scanned surveynotes
scans - read in the scanned surveynotes
survex - read in the survex files
survexpos
tunnel - read in the Tunnel files

View File

@ -197,8 +197,7 @@ class RegistrationFormTests(RegistrationTestCase):
'data':
{ 'username': 'foo/bar',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' },
'password1': 'foo' },
'error':
('username', [u"Enter a valid value."])
},
@ -207,21 +206,10 @@ class RegistrationFormTests(RegistrationTestCase):
'data':
{ 'username': 'alice',
'email': 'alice@example.com',
'password1': 'secret',
'password2': 'secret' },
'password1': 'secret' },
'error':
('username', [u"This username is already taken. Please choose another."])
},
# Mismatched passwords.
{
'data':
{ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'bar' },
'error':
('__all__', [u"You must type the same password each time"])
},
]
for invalid_dict in invalid_data_dicts:
@ -231,8 +219,7 @@ class RegistrationFormTests(RegistrationTestCase):
form = forms.RegistrationForm(data={ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.failUnless(form.is_valid())
def test_registration_form_tos(self):
@ -243,15 +230,13 @@ class RegistrationFormTests(RegistrationTestCase):
"""
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.failIf(form.is_valid())
self.assertEqual(form.errors['tos'], [u"You must agree to the terms to register"])
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo',
'tos': 'on' })
self.failUnless(form.is_valid())
@ -263,15 +248,13 @@ class RegistrationFormTests(RegistrationTestCase):
"""
form = forms.RegistrationFormUniqueEmail(data={ 'username': 'foo',
'email': 'alice@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.failIf(form.is_valid())
self.assertEqual(form.errors['email'], [u"This email address is already in use. Please supply a different email address."])
form = forms.RegistrationFormUniqueEmail(data={ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.failUnless(form.is_valid())
def test_registration_form_no_free_email(self):
@ -281,8 +264,7 @@ class RegistrationFormTests(RegistrationTestCase):
"""
base_data = { 'username': 'foo',
'password1': 'foo',
'password2': 'foo' }
'password1': 'foo' }
for domain in ('aim.com', 'aol.com', 'email.com', 'gmail.com',
'googlemail.com', 'hotmail.com', 'hushmail.com',
'msn.com', 'mail.ru', 'mailinator.com', 'live.com'):
@ -312,8 +294,7 @@ class RegistrationViewTests(RegistrationTestCase):
response = self.client.post(reverse('registration_register'),
data={ 'username': 'alice', # Will fail on username uniqueness.
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.assertEqual(response.status_code, 200)
self.failUnless(response.context['form'])
self.failUnless(response.context['form'].errors)
@ -321,8 +302,7 @@ class RegistrationViewTests(RegistrationTestCase):
response = self.client.post(reverse('registration_register'),
data={ 'username': 'foo',
'email': 'foo@example.com',
'password1': 'foo',
'password2': 'foo' })
'password1': 'foo' })
self.assertEqual(response.status_code, 302)
self.assertEqual(response['Location'], 'http://testserver%s' % reverse('registration_complete'))
self.assertEqual(RegistrationProfile.objects.count(), 3)

View File

@ -81,7 +81,7 @@ def activate(request, activation_key,
context[key] = callable(value) and value() or value
return render_to_response(template_name,
c.update({ 'account': account,
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings':settings}),
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings': settings, }),
context_instance=context,)
@ -166,5 +166,5 @@ def register(request, success_url=None,
for key, value in extra_context.items():
context[key] = callable(value) and value() or value
return render_to_response(template_name,
c.update({ 'form': form,'settings':settings }),
c.update({ 'form': form, 'settings': settings, }),
context_instance=context)