Re: Redesign of djangoproject.com?

2012-05-04 Thread Henry Modisett
Hey django developers! I am new here but I made you a design :)

http://cl.ly/3M0V3Y350B3r1n2g1209

On Saturday, April 28, 2012 3:22:59 AM UTC-4, Dana Woodman wrote:
>
> So now that Django is being moved to Git/Github (which is awesome!), maybe 
> it would be a good time to think about a revamped home page for the project 
> ala djangoproject.com?
>
> Obviously this is no small undertaking and would be potentially 
> contentions as to what would be the proper path, but I feel (and I don't 
> think I'm alone) that djangoproject.com could use a bit of a facelift. 
>
> I have some idea of my own as to how this could be accomplished and I'm 
> sure there are a ton of others out there with great ideas as well. Maybe we 
> could open up some discussion on this idea? 
>
> Forgive me if this has been proposed before as I'm new to the group!
>
> Cheers,
> Dana
>

On Saturday, April 28, 2012 3:22:59 AM UTC-4, Dana Woodman wrote:
>
> So now that Django is being moved to Git/Github (which is awesome!), maybe 
> it would be a good time to think about a revamped home page for the project 
> ala djangoproject.com?
>
> Obviously this is no small undertaking and would be potentially 
> contentions as to what would be the proper path, but I feel (and I don't 
> think I'm alone) that djangoproject.com could use a bit of a facelift. 
>
> I have some idea of my own as to how this could be accomplished and I'm 
> sure there are a ton of others out there with great ideas as well. Maybe we 
> could open up some discussion on this idea? 
>
> Forgive me if this has been proposed before as I'm new to the group!
>
> Cheers,
> Dana
>

-- 
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/-/jGdi0F1NzDsJ.
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: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Anssi Kääriäinen
On May 4, 2:30 pm, Karen Tracey  wrote:
> On Fri, May 4, 2012 at 4:46 AM, Andreas Pelme  wrote:
>
> > That's a good question. Anyone who wrote to original 
> > TransactionTestCase/reordering implementation that wants to chime in? :-)
>
> I worked on the test speedups that introduced TransactionTestCase and
> I added the re-ordering, but the behavior of database flush being done
> at the beginning of a test existed before that work. The conversation
> that led to addition of the reordering is here:
>
> http://groups.google.com/group/django-developers/browse_thread/thread...
>
> doctests (which we have no more?) play a prominent role in that
> discussion. While we have gotten rid of doctests in Django's own
> suite, we still support apps which may use doctests in their code, so
> anything we do to change when the DB is cleared needs to take that
> into account. On the table then was the idea of adding cleanup after
> doctests, possibly that would need to be re-considered if you want to
> move the database clearing to the end of everything rather than the
> beginning of TransactionTestCase.

Thanks for the link. While reading the previous threads I spotted at
one blocker issue: the first TransactionTestCase will not start with
zeroed database sequence values. To prevent this one would need to
flush the DB before the first TransactionTestCase. In addition, if the
goal is to get rid of test ordering, then one would need to flush
before every test case which isn't good. Getting rid of the
requirement to reset sequences between test cases would be good.
Oracle doesn't reset the sequences reliably currently just for
example. But I don't think we can change that for backwards
compatibility reasons. While tests that rely on sequence values are
IMHO broken, changing this would result in numerous broken tests for
users upgrading Django. Notably normal TestCases do not do sequence
resetting at all currently.

This is a blocker: why change the flushing from pre-test to post-test
if the end result is that you can't run the tests in arbitrary order
anyways? Or if you want to be able to run them in arbitrary order you
will need to run at least the sequence resets pre-test anyways.
Resetting sequences can be really expensive, so there goes any
potential savings in speed.

Ideas?

 - Anssi

-- 
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: Customizable Serialization check-in

2012-05-04 Thread Piotr Grabowski

Hi,

During this week I have a lot of work so I didn't manage to present my 
revised proposal in Monday like i said. Sorry. I have it now:

https://gist.github.com/2597306

Next week I hope there will be some discussion about my proposal. I will 
also think how it should be done under the hood. There should be some 
internal API. I should also resolve one Django ticket. I think about 
this https://code.djangoproject.com/ticket/9279 There will be good for 
test cases in my future solution.


I should write my proposal on this group? In github I have nice 
formatting and in this group my Python code was badly formatted.


--
Piotr Grabowski

--
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: Abridged summary of django-developers@googlegroups.com - 10 Messages in 5 Topics

2012-05-04 Thread Kirill Panshin
On 5/4/12, django-developers@googlegroups.com
 wrote:
> =
> Today's Topic Summary
> =
>
> Group: django-developers@googlegroups.com
> Url: http://groups.google.com/group/django-developers/topics
>
>   - Dogfood the new class-based views in contrib.syndication? [2 Updates]
> http://groups.google.com/group/django-developers/t/a053b1dffc037f8c
>   - GitHub migration done! [1 Update]
> http://groups.google.com/group/django-developers/t/f7ef8fe7b7b3c81b
>   - Test reordering and TransactionTestCase cleanup [4 Updates]
> http://groups.google.com/group/django-developers/t/3df2b4926eba08d2
>   - Will django escaping ever consider context of javascript and CSS? [2
> Updates]
> http://groups.google.com/group/django-developers/t/5bfb68e2a779fd6e
>   - Redesign of djangoproject.com? [1 Update]
> http://groups.google.com/group/django-developers/t/d97cbb49900e73b1
>
>
> =
> Topic: Dogfood the new class-based views in contrib.syndication?
> Url: http://groups.google.com/group/django-developers/t/a053b1dffc037f8c
> =
>
> -- 1 of 2 --
> From: Stephen Burrows 
> Date: May 03 01:25AM -0700
> Url: http://groups.google.com/group/django-developers/msg/89a77e9e77892264
>
> I was recently working with django's syndication framework, and noticed
> that it felt clunky in a lot of ways. For example, I can only access the
> request and the kwargs for the function during the
>
> -- 2 of 2 --
> From: Russell Keith-Magee 
> Date: May 04 08:28AM +0800
> Url: http://groups.google.com/group/django-developers/msg/15952a367e410348
>
> On Thu, May 3, 2012 at 4:25 PM, Stephen Burrows
>> whether this is something that (generally speaking) people would be
>> interested in seeing. I tried checking the tracker and google for previous
>
>
> =
> Topic: GitHub migration done!
> Url: http://groups.google.com/group/django-developers/t/f7ef8fe7b7b3c81b
> =
>
> -- 1 of 1 --
> From: Vinay Sajip 
> Date: May 03 03:43PM -0700
> Url: http://groups.google.com/group/django-developers/msg/f01a7438c1354b54
>
>> mirror repo merge-incompatible with the current mirror (and all clones
>> of it). It's possible there will be no way to do that, in which case I
>> guess a new incompatible mirror is still better
>
>
> =
> Topic: Test reordering and TransactionTestCase cleanup
> Url: http://groups.google.com/group/django-developers/t/3df2b4926eba08d2
> =
>
> -- 1 of 4 --
> From: Andreas Pelme 
> Date: May 03 06:29PM +0200
> Url: http://groups.google.com/group/django-developers/msg/ebef3ca741a95843
>
> I am trying to run my Django test suite with an alternative test runner
> (py.test), and found some issues with test isolation.
>
> TransactionTestCase does currently not clean up after itself (i.e.
>
> -- 2 of 4 --
> From: "Anssi Kääriäinen" 
> Date: May 03 10:23AM -0700
> Url: http://groups.google.com/group/django-developers/msg/82c31936f6946be3
>
>
>> Djangos default testrunner reorders the test suite to run all TestCase
>> tests before TransactionTestCases, which avoids this problem. I cannot
>> find this reordering documented anywhere, or even
>
> -- 3 of 4 --
> From: Karen Tracey 
> Date: May 03 03:17PM -0400
> Url: http://groups.google.com/group/django-developers/msg/f0e12859a1ab9dbb
>
>
>> Djangos default testrunner reorders the test suite to run all TestCase
>> tests before TransactionTestCases, which avoids this problem. I cannot
>> find this reordering documented anywhere,
>
>
> -- 4 of 4 --
> From: Ramiro Morales 
> Date: May 03 05:14PM -0300
> Url: http://groups.google.com/group/django-developers/msg/97e1c32e8610a069
>
>
>> TransactionTestCase does currently not clean up after itself (i.e. flush
>> the database), but instead assumes that the next test will flush the
>> database.
>> [...]
>
>> Djangos default testrunner
>
>
> =
> Topic: Will django escaping ever consider context of javascript and CSS?
> Url: http://groups.google.com/group/django-developers/t/5bfb68e2a779fd6e
> =
>
> -- 1 

Re: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Karen Tracey
On Fri, May 4, 2012 at 4:46 AM, Andreas Pelme  wrote:
>
> That's a good question. Anyone who wrote to original 
> TransactionTestCase/reordering implementation that wants to chime in? :-)

I worked on the test speedups that introduced TransactionTestCase and
I added the re-ordering, but the behavior of database flush being done
at the beginning of a test existed before that work. The conversation
that led to addition of the reordering is here:

http://groups.google.com/group/django-developers/browse_thread/thread/1e4f4c840b180895/

doctests (which we have no more?) play a prominent role in that
discussion. While we have gotten rid of doctests in Django's own
suite, we still support apps which may use doctests in their code, so
anything we do to change when the DB is cleared needs to take that
into account. On the table then was the idea of adding cleanup after
doctests, possibly that would need to be re-considered if you want to
move the database clearing to the end of everything rather than the
beginning of TransactionTestCase.

Karen

-- 
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: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Anssi Kääriäinen
On May 4, 10:09 am, Andreas Pelme  wrote:
> Here's the ticket:
>
> https://code.djangoproject.com/ticket/18271
>
> … and an initial patch:
>
> https://github.com/django/django/pull/45

I marked the ticket DDN, there are three reasons:
1. If a test case screws up cleanup it will cause problems for
itself currently, after the patch it will cause problems for the next
test case which makes debugging much harder.
2. Is this backwards incompatible? The behavior was documented.
3. Is there some reason why the flush must be done pre-test which
we are overlooking. Why was it implemented that way originally?
Perhaps because of the first item?

Each test case taking care of cleaning up after itself feels like the
right way to go. There are a couple of reasons:
  - TestCase works already this way: it doesn't do cleanup before, it
just makes sure it cleans after itself (which is easy as it doesn't
leave any trash behind).
  - The database is treated specially. The tests trust other tests to
clean up their state. Settings is an example.
  - As said upthread, this allows for special test case subclasses
which do more intelligent cleanup. I don't think an intelligent
TransactionTestCase subclass which doesn't run flush pre-tests is
possible in the current implementation, as it would then see the trash
of other TransactionTestCases.

But, as said, I left the ticket DDN. None of the issues mentioned
above seem like a blocker. The backwards incompatibility is the most
likely blocker - I can't see that changing the behavior is going to
cause problems, but maybe there are users out there whose test cases
somehow require pre-test flush?

 - Anssi

-- 
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: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Andreas Pelme
On Thursday 3 May 2012 at 19:23, Anssi Kääriäinen wrote:
> On May 3, 7:29 pm, Andreas Pelme  wrote:
> > I am trying to run my Django test suite with an alternative test runner 
> > (py.test), and found some issues with test isolation.
> >  
> > TransactionTestCase does currently not clean up after itself (i.e. flush 
> > the database), but instead assumes that the next test will flush the 
> > database. It is generally a good idea to restore the state after the test 
> > run, and let other tests start out with a known state.
> >  
> > Djangos default testrunner reorders the test suite to run all TestCase 
> > tests before TransactionTestCases, which avoids this problem. I cannot find 
> > this reordering documented anywhere, or even commented anywhere in the 
> > implementation (test/simple.py: reorder_suite and 
> > DjangoTestSuiteRunner.build_suite).
> >  
> > I propose to move the flush command out of _fixture_setup to _post_teardown 
> > in TransactionTestCase. This makes it possible for arbitrary execution 
> > order of the test suite. Performance could potentially be an issue, since 
> > it is "lazy" today and flushes the database just right before it is needed. 
> > That would however only affect the last test in the run (i.e. it will 
> > truncate the tables, and then the database itself will be teared down).
> >  
> > Are there any objections or anything that might break with such a change? 
> > Are there any specific reasons it works the way it does?
>  
> I don't know if anything will break...
>  
> I think this is a good idea. In addition to the above issues this
> would allow the test ran tell the flushing which tables are dirty,
> which not. Currently the transaction_regress for example uses just a
> single table. But after each test, all tables will be truncated, and
> the contenttypes and permissions will be reloaded. I bet we could
> speed up the testing _a lot_ if the cleaning up could be made more
> intelligent. Making it robust is somewhat hard but should not be
> impossible. Of course, the "StateTrackingTestCase" should not be done
> in the same patch at all... just a possibility for future work.


There are indeed some work that can be done to speed up the test running. :)

Here's the ticket:
  
https://code.djangoproject.com/ticket/18271  

… and an initial patch:

https://github.com/django/django/pull/45

Is there any sane way to test this except to run the test suite itself?

Andreas


-- 
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: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Andreas Pelme
On Thursday 3 May 2012 at 22:14, Ramiro Morales wrote:
> On Thu, May 3, 2012 at 1:29 PM, Andreas Pelme  (mailto:andr...@pelme.se)> wrote:
> > I am trying to run my Django test suite with an alternative test runner 
> > (py.test), and found some issues with test isolation.
> > 
> > TransactionTestCase does currently not clean up after itself (i.e. flush 
> > the database), but instead assumes that the next test will flush the 
> > database.
> > [...]
> > 
> > Djangos default testrunner reorders the test suite to run all TestCase 
> > tests before TransactionTestCases, which avoids this problem.
> 
> Just a quick related note
> 
> There is a [1]proposal to extend this reordering to be:
> 
> * TestCases
> * doctests
> * TransactionTestCases
> 
> So doctests aren't affected either.
> 
> I intend to commit a fix for it soon.
> 
> -- 
> Ramiro Morales
> 
> 1. https://code.djangoproject.com/ticket/12408

This won't be an issue if TransactionTestCase resets the database after itself.

Andreas 


-- 
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: Test reordering and TransactionTestCase cleanup

2012-05-04 Thread Andreas Pelme
On Thursday 3 May 2012 at 21:17, Karen Tracey wrote:
> On Thu, May 3, 2012 at 12:29 PM, Andreas Pelme  (mailto:andr...@pelme.se)> wrote:
> > 
> > Djangos default testrunner reorders the test suite to run all TestCase 
> > tests before TransactionTestCases, which avoids this problem. I cannot find 
> > this reordering documented anywhere,
> 
> It is documented:
> https://docs.djangoproject.com/en/1.4/topics/testing/#django.test.TransactionTestCase
> 
> Mentioned in both the 3rd paragraph and the note.
Thanks -- I'm not sure how I missed that. I'll make sure my patch updates the 
docs too.

Andreas


-- 
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.