Tutorials

2013-01-06 Thread Daniele Procida
I am one of those people who can only learn things by doing them, and finds it 
very hard to grasp things from reference materials. The Django documentation is 
excellent on the latter, but not quite so good on the tutorials that would 
guide me through doing things in a way that will help me learn.

I've made a couple of tutorial contributions so far (which if I am honest 
simply reflect the steps I took when I was learning the topic). They are the 
testing tutorial  and 
a uWSGI/nginx tutorial, which though it may not be quite right for the Django 
docs has gone into the uWSGI docs.

I'd like to contribute more tutorials to the documentation, and since the next 
thing I need to get to grips with is logging I will write my own notes so I 
remember how to do it, and I could create a tutorial for it.

Would that be useful for the documentation? I realise that a tutorial is always 
going to be a partial and incomplete introduction to a subject, but newcomers 
need to start with something concrete, and it gives them some purchase on the 
reference material that is already provided.

Are there other topics that really ought to have tutorials written for them?

Daniele

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



Re: Minor feature: Make TestCase pass the testcase instance to self.client's constructor

2013-01-06 Thread Michael Hudson-Doyle
On 5 January 2013 05:23, Malcolm Box  wrote:
>
> The general pattern I want to implement is have a test client that makes 
> assertions about all the requests made during a set of tests. For example, it 
> could check that every get() returned cache headers, or that content_type is 
> always specified in responses. Or that the response has certain HTML, uses 
> certain templates etc - ie all of the assertion testing goodness in 
> django.test.TestCase.
>
> My concrete use case is a JSONClient that adds a json_get / json_post methods 
> which makes sure to setup content_type etc on the call, and then validates 
> that what came back was valid JSON.
>
> The simple, wrong way is to do:
>
> def check_response(self, response):
>self.assertContains(response, )
>
>
> def test():
>r = self.client.get(...)
>self.check_response(r)
>
> but this is error prone, verbose etc etc.
>
> The right thing is that within a test suite, the get()/post() etc to do the 
> checks for me - and so it should be possible to create a testclient that does 
> this, and be able to use this testclient in various test suites.

I don't know that an appeal to authority is useful here, but I
disagree with your "wrong" and "right" assessments.  Have you heard of
the concept of the "four phase test"?
http://xunitpatterns.com/Four%20Phase%20Test.html

One of the things about tests is that they need to be understandable
at a glance.  Having the "exercise" and "verify" steps clearly
separated helps with this IMHO, and the approach you're proposing
doesn't really lend itself to this.

(If your local library or a friend or someone has the book "xUnit Test
Patterns", the first 150 pages or so are extremely well worth reading)

Cheers,
mwh

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.



About Understanding of source code

2013-01-06 Thread Mayur Patil
Hello there,

  I want to understand how to get deep insight into Django code?

  Thank You.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-developers/-/CcvuNeLYrJsJ.
To post to this group, send email to django-developers@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.