forked from expo/troggle
Document 'cavesnew' option in databasereset.py - which just reads in
caves datafiles.
This commit is contained in:
parent
6b84d811a2
commit
4d6f8cb079
@ -167,12 +167,14 @@ def usage():
|
|||||||
where command is:
|
where command is:
|
||||||
reset - this is normal usage, clear database and reread everything
|
reset - this is normal usage, clear database and reread everything
|
||||||
desc
|
desc
|
||||||
|
cavesnew - read in the caves
|
||||||
logbooks - read in the logbooks
|
logbooks - read in the logbooks
|
||||||
autologbooks
|
autologbooks
|
||||||
dumplogbooks
|
dumplogbooks
|
||||||
|
people
|
||||||
QMs - read in the QM files
|
QMs - read in the QM files
|
||||||
resetend
|
resetend
|
||||||
scans - reaq in the scanned surveynotes
|
scans - read in the scanned surveynotes
|
||||||
survex - read in the survex files
|
survex - read in the survex files
|
||||||
survexpos
|
survexpos
|
||||||
tunnel - read in the Tunnel files
|
tunnel - read in the Tunnel files
|
||||||
|
@ -197,8 +197,7 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
'data':
|
'data':
|
||||||
{ 'username': 'foo/bar',
|
{ 'username': 'foo/bar',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' },
|
||||||
'password2': 'foo' },
|
|
||||||
'error':
|
'error':
|
||||||
('username', [u"Enter a valid value."])
|
('username', [u"Enter a valid value."])
|
||||||
},
|
},
|
||||||
@ -207,21 +206,10 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
'data':
|
'data':
|
||||||
{ 'username': 'alice',
|
{ 'username': 'alice',
|
||||||
'email': 'alice@example.com',
|
'email': 'alice@example.com',
|
||||||
'password1': 'secret',
|
'password1': 'secret' },
|
||||||
'password2': 'secret' },
|
|
||||||
'error':
|
'error':
|
||||||
('username', [u"This username is already taken. Please choose another."])
|
('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:
|
for invalid_dict in invalid_data_dicts:
|
||||||
@ -231,8 +219,7 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
|
|
||||||
form = forms.RegistrationForm(data={ 'username': 'foo',
|
form = forms.RegistrationForm(data={ 'username': 'foo',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.failUnless(form.is_valid())
|
self.failUnless(form.is_valid())
|
||||||
|
|
||||||
def test_registration_form_tos(self):
|
def test_registration_form_tos(self):
|
||||||
@ -243,15 +230,13 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
"""
|
"""
|
||||||
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
|
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.failIf(form.is_valid())
|
self.failIf(form.is_valid())
|
||||||
self.assertEqual(form.errors['tos'], [u"You must agree to the terms to register"])
|
self.assertEqual(form.errors['tos'], [u"You must agree to the terms to register"])
|
||||||
|
|
||||||
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
|
form = forms.RegistrationFormTermsOfService(data={ 'username': 'foo',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo',
|
||||||
'password2': 'foo',
|
|
||||||
'tos': 'on' })
|
'tos': 'on' })
|
||||||
self.failUnless(form.is_valid())
|
self.failUnless(form.is_valid())
|
||||||
|
|
||||||
@ -263,15 +248,13 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
"""
|
"""
|
||||||
form = forms.RegistrationFormUniqueEmail(data={ 'username': 'foo',
|
form = forms.RegistrationFormUniqueEmail(data={ 'username': 'foo',
|
||||||
'email': 'alice@example.com',
|
'email': 'alice@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.failIf(form.is_valid())
|
self.failIf(form.is_valid())
|
||||||
self.assertEqual(form.errors['email'], [u"This email address is already in use. Please supply a different email address."])
|
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',
|
form = forms.RegistrationFormUniqueEmail(data={ 'username': 'foo',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.failUnless(form.is_valid())
|
self.failUnless(form.is_valid())
|
||||||
|
|
||||||
def test_registration_form_no_free_email(self):
|
def test_registration_form_no_free_email(self):
|
||||||
@ -281,8 +264,7 @@ class RegistrationFormTests(RegistrationTestCase):
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
base_data = { 'username': 'foo',
|
base_data = { 'username': 'foo',
|
||||||
'password1': 'foo',
|
'password1': 'foo' }
|
||||||
'password2': 'foo' }
|
|
||||||
for domain in ('aim.com', 'aol.com', 'email.com', 'gmail.com',
|
for domain in ('aim.com', 'aol.com', 'email.com', 'gmail.com',
|
||||||
'googlemail.com', 'hotmail.com', 'hushmail.com',
|
'googlemail.com', 'hotmail.com', 'hushmail.com',
|
||||||
'msn.com', 'mail.ru', 'mailinator.com', 'live.com'):
|
'msn.com', 'mail.ru', 'mailinator.com', 'live.com'):
|
||||||
@ -312,8 +294,7 @@ class RegistrationViewTests(RegistrationTestCase):
|
|||||||
response = self.client.post(reverse('registration_register'),
|
response = self.client.post(reverse('registration_register'),
|
||||||
data={ 'username': 'alice', # Will fail on username uniqueness.
|
data={ 'username': 'alice', # Will fail on username uniqueness.
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.assertEqual(response.status_code, 200)
|
self.assertEqual(response.status_code, 200)
|
||||||
self.failUnless(response.context['form'])
|
self.failUnless(response.context['form'])
|
||||||
self.failUnless(response.context['form'].errors)
|
self.failUnless(response.context['form'].errors)
|
||||||
@ -321,8 +302,7 @@ class RegistrationViewTests(RegistrationTestCase):
|
|||||||
response = self.client.post(reverse('registration_register'),
|
response = self.client.post(reverse('registration_register'),
|
||||||
data={ 'username': 'foo',
|
data={ 'username': 'foo',
|
||||||
'email': 'foo@example.com',
|
'email': 'foo@example.com',
|
||||||
'password1': 'foo',
|
'password1': 'foo' })
|
||||||
'password2': 'foo' })
|
|
||||||
self.assertEqual(response.status_code, 302)
|
self.assertEqual(response.status_code, 302)
|
||||||
self.assertEqual(response['Location'], 'http://testserver%s' % reverse('registration_complete'))
|
self.assertEqual(response['Location'], 'http://testserver%s' % reverse('registration_complete'))
|
||||||
self.assertEqual(RegistrationProfile.objects.count(), 3)
|
self.assertEqual(RegistrationProfile.objects.count(), 3)
|
||||||
|
@ -81,7 +81,7 @@ def activate(request, activation_key,
|
|||||||
context[key] = callable(value) and value() or value
|
context[key] = callable(value) and value() or value
|
||||||
return render_to_response(template_name,
|
return render_to_response(template_name,
|
||||||
c.update({ 'account': account,
|
c.update({ 'account': account,
|
||||||
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings':settings}),
|
'expiration_days': settings.ACCOUNT_ACTIVATION_DAYS, 'settings': settings, }),
|
||||||
context_instance=context,)
|
context_instance=context,)
|
||||||
|
|
||||||
|
|
||||||
@ -166,5 +166,5 @@ def register(request, success_url=None,
|
|||||||
for key, value in extra_context.items():
|
for key, value in extra_context.items():
|
||||||
context[key] = callable(value) and value() or value
|
context[key] = callable(value) and value() or value
|
||||||
return render_to_response(template_name,
|
return render_to_response(template_name,
|
||||||
c.update({ 'form': form,'settings':settings }),
|
c.update({ 'form': form, 'settings': settings, }),
|
||||||
context_instance=context)
|
context_instance=context)
|
||||||
|
Loading…
Reference in New Issue
Block a user