On Sun, 2009-08-09 at 00:52 -0700, Rudolph wrote:
> Hi,
> 
> On Aug 9, 4:11 am, Malcolm Tredinnick <[email protected]>
> wrote:
> > So tests that show a particular format string produces a particular
> > result aren't really useful. It just shows that the author of the format
> > string understood what the result should be, not that the format string
> > is correct. Thus, I'm not quite sure what locale-specific tests Rudolph
> > is thinking of adding here.
> 
> I was mainly thinking about tests for the input formats to make sure
> that the most common (in this case Dutch) date strings get conversed
> to Python elements. But I guess from Malcolms answer that it's not
> worth creating tests for that although it would make sure that future
> modifications or additions to these input formats still correctly
> work. I'll submit the Dutch formats without tests for now.

Not so fast. :-)

I think that is one of those things that is worth testing. You are
testing a functionality where the result isn't determined by something
in Django. Testing output formats is determined by whatever we might put
into Django as possible output format strings. Checking that the input
1,23 is correctly parsed as Decimal("1.23") in that locale and 7.8.09 is
correctly parsed as August 7th, 2009 as a date function, is an external
functional requirement. 

Testing that the date "august 7th, 2009" is displayed as 7.8.09 when
given a string that says to use "%d.%m.%Y" is only testing that the
format string to display routines are working and that's a case that I
would argue is (or should be) already being tested, so it's not worth
duplicating for each locale.

Sorry if that sounds confusing. It's kind of clear in my head which
cases I think are worth testing and not, but it might not be clear to
anybody else. Some features' results should be determined by external
factors (input being one of them). Some results are only determined by
how we specify the internal config of Django (e.g. date formats --
there's nothing user-generated content can do to influence that). The
former are worth testing, because changing it breaks user expectations
and code.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django I18N" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Django-I18N?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to