Re: How Important Is Writing Unit Tests For Django Applications?

2022-03-12 Thread Mike Dewhirst

On 13/03/2022 5:00 am, Daniel Coker wrote:
I understand the importance of unit testing. However, if we are going 
to write integration tests (testing the views), this test will step 
through all of the modules that we would otherwise unit test.


So, I'm wondering, it it really necessary to write unit test for 
Django Applications when we will still test the views?


1.    If you don't unit test your bits and pieces AND you call them in 
your views they might pass with wrong values. Subtle errors can creep in 
if your views are tested too coarsely.


2.    The more fine-grained the unit tests the easier it is to refactor 
your view code.


3.    Do you use Coverage? You will see all the Django code is tested. 
Only your own code to test


I do integration testing at a high level as well as down low. Really 
does wonders for refactoring confidence.


YMMV

Mike


--
You received this message because you are subscribed to the Google 
Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send 
an email to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0cf2d7c-79cb-41a5-801a-4240c3c0c1c1n%40googlegroups.com 
.



--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d076ee0f-6b30-408d-9bd8-df83a0deb893%40dewhirst.com.au.


OpenPGP_signature
Description: OpenPGP digital signature


How Important Is Writing Unit Tests For Django Applications?

2022-03-12 Thread Daniel Coker
I understand the importance of unit testing. However, if we are going to 
write integration tests (testing the views), this test will step through 
all of the modules that we would otherwise unit test.

So, I'm wondering, it it really necessary to write unit test for Django 
Applications when we will still test the views?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/d0cf2d7c-79cb-41a5-801a-4240c3c0c1c1n%40googlegroups.com.


Re: Reusable django templates

2022-03-12 Thread Clive Bruton



On 12 Mar 2022, at 17:43, Heman Okumbo wrote:

How comes I'm not able to modify my templates after extending from  
a base template.eg can't add extra contents,the template only  
display contents of the inherited template.


Some code might help. It's not really clear to me what you are asking.

But at a guess, you can use the {% include … %} template function to  
extend templates.



-- Clive

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2B3DC48B-D567-45A9-B182-66D13D81B4AF%40indx.co.uk.


Reusable django templates

2022-03-12 Thread Heman Okumbo
How comes I'm not able to modify my templates after extending from a base
template.eg can't add extra contents,the template only display contents of
the inherited template.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAJt9CbhJjE61OES-iTrRicpxH9GwtjPaWKr4wVovH%3DTsZqc8TQ%40mail.gmail.com.