Ticket #9345: fixes_new.patch

File fixes_new.patch, 22.0 KB (added by Florian Sening, 16 years ago)
  • django/conf/global_settings.py

     
    180180# the site managers.
    181181DEFAULT_FROM_EMAIL = 'webmaster@localhost'
    182182
    183 # Subject-line prefix for email messages send with django.core.mail.mail_admins
     183# Subject-line prefix for e-mail messages send with django.core.mail.mail_admins
    184184# or ...mail_managers.  Make sure to include the trailing space.
    185185EMAIL_SUBJECT_PREFIX = '[Django] '
    186186
  • django/contrib/auth/management/commands/createsuperuser.py

     
    2727        make_option('--username', dest='username', default=None,
    2828            help='Specifies the username for the superuser.'),
    2929        make_option('--email', dest='email', default=None,
    30             help='Specifies the email address for the superuser.'),
     30            help='Specifies the e-mail address for the superuser.'),
    3131        make_option('--noinput', action='store_false', dest='interactive', default=True,
    3232            help='Tells Django to NOT prompt the user for input of any kind. '    \
    3333                 'You must use --username and --email with --noinput, and '      \
     
    5050            try:
    5151                is_valid_email(email)
    5252            except exceptions.ValidationError:
    53                 raise CommandError("Invalid email address.")
     53                raise CommandError("Invalid e-mail address.")
    5454
    5555        password = ''
    5656
     
    100100                        sys.stderr.write("Error: That username is already taken.\n")
    101101                        username = None
    102102           
    103                 # Get an email
     103                # Get an e-mail
    104104                while 1:
    105105                    if not email:
    106106                        email = raw_input('E-mail address: ')
  • django/contrib/auth/tests/views.py

     
    1212    urls = 'django.contrib.auth.urls'
    1313
    1414    def test_email_not_found(self):
    15         "Error is raised if the provided email address isn't currently registered"
     15        "Error is raised if the provided e-mail address isn't currently registered"
    1616        response = self.client.get('/password_reset/')
    1717        self.assertEquals(response.status_code, 200)
    1818        response = self.client.post('/password_reset/', {'email': 'not_a_real_email@email.com'})
     
    2020        self.assertEquals(len(mail.outbox), 0)
    2121
    2222    def test_email_found(self):
    23         "Email is sent if a valid email address is provided for password reset"
     23        "E-mail is sent if a valid e-mail address is provided for password reset"
    2424        response = self.client.post('/password_reset/', {'email': 'staffmember@example.com'})
    2525        self.assertEquals(response.status_code, 302)
    2626        self.assertEquals(len(mail.outbox), 1)
    2727        self.assert_("http://" in mail.outbox[0].body)
    2828
    2929    def _test_confirm_start(self):
    30         # Start by creating the email
     30        # Start by creating the e-mail
    3131        response = self.client.post('/password_reset/', {'email': 'staffmember@example.com'})
    3232        self.assertEquals(response.status_code, 302)
    3333        self.assertEquals(len(mail.outbox), 1)
     
    3535
    3636    def _read_signup_email(self, email):
    3737        urlmatch = re.search(r"https?://[^/]*(/.*reset/\S*)", email.body)
    38         self.assert_(urlmatch is not None, "No URL found in sent email")
     38        self.assert_(urlmatch is not None, "No URL found in sent e-mail")
    3939        return urlmatch.group(), urlmatch.groups()[0]
    4040
    4141    def test_confirm_valid(self):
  • django/contrib/comments/forms.py

     
    1717
    1818class CommentForm(forms.Form):
    1919    name          = forms.CharField(label=_("Name"), max_length=50)
    20     email         = forms.EmailField(label=_("Email address"))
     20    email         = forms.EmailField(label=_("E-mail address"))
    2121    url           = forms.URLField(label=_("URL"), required=False)
    2222    comment       = forms.CharField(label=_('Comment'), widget=forms.Textarea,
    2323                                    max_length=COMMENT_MAX_LENGTH)
  • django/contrib/comments/models.py

     
    4848    # was posted by a non-authenticated user.
    4949    user        = models.ForeignKey(User, blank=True, null=True, related_name="%(class)s_comments")
    5050    user_name   = models.CharField(_("user's name"), max_length=50, blank=True)
    51     user_email  = models.EmailField(_("user's email address"), blank=True)
     51    user_email  = models.EmailField(_("user's e-mail address"), blank=True)
    5252    user_url    = models.URLField(_("user's URL"), blank=True)
    5353
    5454    comment = models.TextField(_('comment'), max_length=COMMENT_MAX_LENGTH)
     
    122122    def _set_email(self, val):
    123123        if self.user_id:
    124124            raise AttributeError(_("This comment was posted by an authenticated "\
    125                                    "user and thus the email is read-only."))
     125                                   "user and thus the e-mail is read-only."))
    126126        self.user_email = val
    127     email = property(_get_email, _set_email, doc="The email of the user who posted this comment")
     127    email = property(_get_email, _set_email, doc="The e-mail of the user who posted this comment")
    128128
    129129    def _get_url(self):
    130130        return self.userinfo["url"]
     
    137137
    138138    def get_as_text(self):
    139139        """
    140         Return this comment as plain text.  Useful for emails.
     140        Return this comment as plain text. Useful for e-mails.
    141141        """
    142142        d = {
    143143            'user': self.user,
  • django/contrib/comments/templates/comments/moderation_queue.html

     
    3333          <th>{% trans "Action" %}</th>
    3434          <th>{% trans "Name" %}</th>
    3535          <th>{% trans "Comment" %}</th>
    36           <th>{% trans "Email" %}</th>
     36          <th>{% trans "E-mail" %}</th>
    3737          <th>{% trans "URL" %}</th>
    3838          <th>{% trans "Authenticated?" %}</th>
    39           <th>{% trans "IP Address" %}</th>
     39          <th>{% trans "IP address" %}</th>
    4040          <th class="sorted desc">{% trans "Date posted" %}</th>
    4141        </tr>
    4242    </thead>
     
    6060          <td>
    6161            <img
    6262              src="{% admin_media_prefix %}img/admin/icon-{% if comment.user %}yes{% else %}no{% endif %}.gif"
    63               alt="{% if comment.user %}{% trans "yes" %}{% else %}{% trans "no" %}{% endif %}"
     63              alt="{% if comment.user %}{% trans "Yes" %}{% else %}{% trans "No" %}{% endif %}"
    6464            />
    6565          </td>
    6666          <td>{{ comment.ip_address }}</td>
  • django/contrib/comments/templates/comments/preview.html

     
    77  {% load comments %}
    88  <form action="{% comment_form_target %}" method="post">
    99    {% if form.errors %}
    10     <h1>{% blocktrans count form.errors|length as counter %}Please correct the error below{% plural %}Please correct the errors below{% endblocktrans %}</h1>
     10    <h1>{% blocktrans count form.errors|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}</h1>
    1111    {% else %}
    1212    <h1>{% trans "Preview your comment" %}</h1>
    1313      <blockquote>{{ comment|linebreaks }}</blockquote>
  • django/core/mail.py

     
    11"""
    2 Tools for sending email.
     2Tools for sending e-mail.
    33"""
    44
    55import mimetypes
     
    118118
    119119    def open(self):
    120120        """
    121         Ensures we have a connection to the email server. Returns whether or
     121        Ensures we have a connection to the e-mail server. Returns whether or
    122122        not a new connection was required (True or False).
    123123        """
    124124        if self.connection:
     
    141141                raise
    142142
    143143    def close(self):
    144         """Closes the connection to the email server."""
     144        """Closes the connection to the e-mail server."""
    145145        try:
    146146            try:
    147147                self.connection.quit()
     
    158158
    159159    def send_messages(self, email_messages):
    160160        """
    161         Sends one or more EmailMessage objects and returns the number of email
     161        Sends one or more EmailMessage objects and returns the number of e-mail
    162162        messages sent.
    163163        """
    164164        if not email_messages:
     
    201201    def __init__(self, subject='', body='', from_email=None, to=None, bcc=None,
    202202            connection=None, attachments=None, headers=None):
    203203        """
    204         Initialize a single email message (which can be sent to multiple
     204        Initialize a single e-mail message (which can be sent to multiple
    205205        recipients).
    206206
    207207        All strings used to create the message can be unicode strings (or UTF-8
     
    248248        msg['From'] = self.from_email
    249249        msg['To'] = ', '.join(self.to)
    250250
    251         # Email header names are case-insensitive (RFC 2045), so we have to
     251        # E-mail header names are case-insensitive (RFC 2045), so we have to
    252252        # accommodate that when doing comparisons.
    253253        header_names = [key.lower() for key in self.extra_headers]
    254254        if 'date' not in header_names:
     
    261261
    262262    def recipients(self):
    263263        """
    264         Returns a list of all recipients of the email (includes direct
     264        Returns a list of all recipients of the e-mail (includes direct
    265265        addressees as well as Bcc entries).
    266266        """
    267267        return self.to + self.bcc
    268268
    269269    def send(self, fail_silently=False):
    270         """Sends the email message."""
     270        """Sends the e-mail message."""
    271271        if not self.recipients():
    272272            # Don't bother creating the network connection if there's nobody to
    273273            # send to.
  • django/test/utils.py

     
    1616
    1717class TestSMTPConnection(object):
    1818    """A substitute SMTP connection for use during test sessions.
    19     The test connection stores email messages in a dummy outbox,
     19    The test connection stores e-mail messages in a dummy outbox,
    2020    rather than sending them out on the wire.
    21 
    2221    """
    2322    def __init__(*args, **kwargs):
    2423        pass
     
    3736    """Perform any global pre-test setup. This involves:
    3837
    3938        - Installing the instrumented test renderer
    40         - Diverting the email sending functions to a test buffer
     39        - Diverting the e-mail sending functions to a test buffer
    4140        - Setting the active locale to match the LANGUAGE_CODE setting.
    4241    """
    4342    Template.original_render = Template.render
     
    5453    """Perform any global post-test teardown. This involves:
    5554
    5655        - Restoring the original test renderer
    57         - Restoring the email sending functions
    58 
     56        - Restoring the e-mail sending functions
    5957    """
    6058    Template.render = Template.original_render
    6159    del Template.original_render
  • django/utils/feedgenerator.py

     
    2525from django.utils.encoding import force_unicode, iri_to_uri
    2626
    2727def rfc2822_date(date):
    28     # We do this ourselves to be timezone aware, email.Utils is not tz aware.
     28    # We do this ourselves to be timezone aware, e-mail. Utils is not tz aware.
    2929    if date.tzinfo:
    3030        time_str = date.strftime('%a, %d %b %Y %H:%M:%S ')
    3131        offset = date.tzinfo.utcoffset(date)
  • docs/howto/error-reporting.txt

     
    1111However, running with :setting:`DEBUG` set to ``False`` means you'll never see
    1212errors generated by your site -- everyone will just see your public error pages.
    1313You need to keep track of errors that occur in deployed sites, so Django can be
    14 configured to email you details of those errors.
     14configured to e-mail you details of those errors.
    1515
    1616Server errors
    1717-------------
     
    2929404 errors
    3030----------
    3131
    32 Django can also be configured to email errors about broken links (404 "page
    33 not found" errors). Django sends emails about 404 errors when:
     32Django can also be configured to e-mail errors about broken links (404 "page
     33not found" errors). Django sends e-mails about 404 errors when:
    3434
    3535    * :setting:`DEBUG` is ``False``
    3636   
  • docs/ref/forms/validation.txt

     
    154154    class MultiEmailField(forms.Field):
    155155        def clean(self, value):
    156156            """
    157             Check that the field contains one or more comma-separated emails
    158             and normalizes the data to a list of the email strings.
     157            Check that the field contains one or more comma-separated e-mails
     158            and normalizes the data to a list of the e-mail strings.
    159159            """
    160160            if not value:
    161161                raise forms.ValidationError('Enter at least one e-mail address.')
  • docs/topics/forms/index.txt

     
    218218        </div>
    219219        <div class="fieldWrapper">
    220220            {{ form.sender.errors }}
    221             <label for="id_sender">Your email address:</label>
     221            <label for="id_sender">Your e-mail address:</label>
    222222            {{ form.sender }}
    223223        </div>
    224224        <div class="fieldWrapper">
  • tests/modeltests/test_client/models.py

     
    177177        "POST erroneous data to a form"
    178178        post_data = {
    179179            'text': 'Hello World',
    180             'email': 'not an email address',
     180            'email': 'not an e-mail address',
    181181            'value': 37,
    182182            'single': 'b',
    183183            'multi': ('b','c','e')
     
    388388
    389389        self.assertEqual(len(mail.outbox), 1)
    390390        self.assertEqual(mail.outbox[0].subject, 'Test message')
    391         self.assertEqual(mail.outbox[0].body, 'This is a test email')
     391        self.assertEqual(mail.outbox[0].body, 'This is a test e-mail')
    392392        self.assertEqual(mail.outbox[0].from_email, 'from@example.com')
    393393        self.assertEqual(mail.outbox[0].to[0], 'first@example.com')
    394394        self.assertEqual(mail.outbox[0].to[1], 'second@example.com')
     
    401401
    402402        self.assertEqual(len(mail.outbox), 2)
    403403        self.assertEqual(mail.outbox[0].subject, 'First Test message')
    404         self.assertEqual(mail.outbox[0].body, 'This is the first test email')
     404        self.assertEqual(mail.outbox[0].body, 'This is the first test e-mail')
    405405        self.assertEqual(mail.outbox[0].from_email, 'from@example.com')
    406406        self.assertEqual(mail.outbox[0].to[0], 'first@example.com')
    407407        self.assertEqual(mail.outbox[0].to[1], 'second@example.com')
    408408
    409409        self.assertEqual(mail.outbox[1].subject, 'Second Test message')
    410         self.assertEqual(mail.outbox[1].body, 'This is the second test email')
     410        self.assertEqual(mail.outbox[1].body, 'This is the second test e-mail')
    411411        self.assertEqual(mail.outbox[1].from_email, 'from@example.com')
    412412        self.assertEqual(mail.outbox[1].to[0], 'second@example.com')
    413413        self.assertEqual(mail.outbox[1].to[1], 'third@example.com')
  • tests/modeltests/test_client/views.py

     
    184184def mail_sending_view(request):
    185185    EmailMessage(
    186186        "Test message",
    187         "This is a test email",
     187        "This is a test e-mail",
    188188        "from@example.com",
    189189        ['first@example.com', 'second@example.com']).send()
    190190    return HttpResponse("Mail sent")
     
    192192def mass_mail_sending_view(request):
    193193    m1 = EmailMessage(
    194194        'First Test message',
    195         'This is the first test email',
     195        'This is the first test e-mail',
    196196        'from@example.com',
    197197        ['first@example.com', 'second@example.com'])
    198198    m2 = EmailMessage(
    199199        'Second Test message',
    200         'This is the second test email',
     200        'This is the second test e-mail',
    201201        'from@example.com',
    202202        ['second@example.com', 'third@example.com'])
    203203
  • tests/regressiontests/forms/extra.py

     
    440440>>> print f.as_p()
    441441<p>Name: <input type="text" name="name" maxlength="50" /></p>
    442442<div class="errorlist"><div class="error">Enter a valid e-mail address.</div></div>
    443 <p>Email: <input type="text" name="email" value="invalid" /></p>
     443<p>E-mail: <input type="text" name="email" value="invalid" /></p>
    444444<div class="errorlist"><div class="error">This field is required.</div></div>
    445445<p>Comment: <input type="text" name="comment" /></p>
    446446
  • tests/regressiontests/templates/filters.py

     
    134134        'filter-urlize06': ('{{ a|urlize }}', {"a": "<script>alert('foo')</script>"}, '&lt;script&gt;alert(&#39;foo&#39;)&lt;/script&gt;'),
    135135
    136136        # mailto: testing for urlize
    137         'filter-urlize07': ('{{ a|urlize }}', {"a": "Email me at me@example.com"}, 'Email me at <a href="mailto:me@example.com">me@example.com</a>'),
    138         'filter-urlize08': ('{{ a|urlize }}', {"a": "Email me at <me@example.com>"}, 'Email me at &lt;<a href="mailto:me@example.com">me@example.com</a>&gt;'),
     137        'filter-urlize07': ('{{ a|urlize }}', {"a": "E-mail me at me@example.com"}, 'E-mail me at <a href="mailto:me@example.com">me@example.com</a>'),
     138        'filter-urlize08': ('{{ a|urlize }}', {"a": "E-mail me at <me@example.com>"}, 'E-mail me at &lt;<a href="mailto:me@example.com">me@example.com</a>&gt;'),
    139139
    140140        'filter-urlizetrunc01': ('{% autoescape off %}{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}{% endautoescape %}', {"a": '"Unsafe" http://example.com/x=&y=', "b": mark_safe('&quot;Safe&quot; http://example.com?x=&amp;y=')}, u'"Unsafe" <a href="http://example.com/x=&y=" rel="nofollow">http:...</a> &quot;Safe&quot; <a href="http://example.com?x=&amp;y=" rel="nofollow">http:...</a>'),
    141141        'filter-urlizetrunc02': ('{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}', {"a": '"Unsafe" http://example.com/x=&y=', "b": mark_safe('&quot;Safe&quot; http://example.com?x=&amp;y=')}, u'&quot;Unsafe&quot; <a href="http://example.com/x=&amp;y=" rel="nofollow">http:...</a> &quot;Safe&quot; <a href="http://example.com?x=&amp;y=" rel="nofollow">http:...</a>'),
  • tests/regressiontests/test_client_regress/models.py

     
    153153        "An assertion is raised if the form name is unknown"
    154154        post_data = {
    155155            'text': 'Hello World',
    156             'email': 'not an email address',
     156            'email': 'not an e-mail address',
    157157            'value': 37,
    158158            'single': 'b',
    159159            'multi': ('b','c','e')
     
    171171        "An assertion is raised if the field name is unknown"
    172172        post_data = {
    173173            'text': 'Hello World',
    174             'email': 'not an email address',
     174            'email': 'not an e-mail address',
    175175            'value': 37,
    176176            'single': 'b',
    177177            'multi': ('b','c','e')
     
    189189        "An assertion is raised if the field doesn't have any errors"
    190190        post_data = {
    191191            'text': 'Hello World',
    192             'email': 'not an email address',
     192            'email': 'not an e-mail address',
    193193            'value': 37,
    194194            'single': 'b',
    195195            'multi': ('b','c','e')
     
    207207        "An assertion is raised if the field doesn't contain the provided error"
    208208        post_data = {
    209209            'text': 'Hello World',
    210             'email': 'not an email address',
     210            'email': 'not an e-mail address',
    211211            'value': 37,
    212212            'single': 'b',
    213213            'multi': ('b','c','e')
     
    228228        """
    229229        post_data = {
    230230            'text': 'Hello World',
    231             'email': 'not an email address',
     231            'email': 'not an e-mail address',
    232232            'value': 37,
    233233            'single': 'b',
    234234            'multi': ('b','c','e')
Back to Top