Re: How to stop testserver from within a test case?

2014-11-19 Thread Peter Inglesby
Hi Arun,

This group is for discussion of development of Django itself.  Your
question is better suited to the 'Django users' group:
https://groups.google.com/forum/#!forum/django-users

All the best,

Peter

On 18 November 2014 15:51, Arun Marathe  wrote:

>
>
>
> We have Django 1.6.
>
> For a somewhat obscure reason, I need to stop the testserver from within a
> test case. Any ideas?
> I would like a programmatic solution if possible. Finding a process and
> killing it (ps -ef., then grep,
> then kill) is bit of a hack, and may end up killing unintended processes.
>
> Note that I want the testserver stopped for a small number of test cases.
> For the rest of them, the
> testserver should be running as it always does.
>
> Thanks,
> Arun
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-developers.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-developers/422b87d4-f4c2-468b-a4ad-1219f61b96e5%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAENJrP%3DQ324Z-jHeUH3bdQM1uG2BmOsiPkL%2BhiFiVONV0zd1Jw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Enhancement to assertQuerysetEqual

2020-02-04 Thread Peter Inglesby
Hi folks,

I always find the behaviour of assertQuerysetEqual surprising, particularly
when I pass it two querysets that I expect to be the same, or when the
second argument is a list of model instances.

Under the covers, assertQuerysetEqual(xs, ys) is roughly equivalent to
assert [repr(x) for x in xs] == ys, and an optional transform parameter can
be passed in to be used instead of repr().

So assertQuerysetEqual(qs1, qs2) is never going to do the right thing and
there's always ten seconds of head scratching while I look at something
like:

AssertionError: Lists differ: ['', ''] != [, ]

I know that I can use assertCountEqual from the standard library, and I
think at the very minimum this should be mentioned in the docs for
assertQuerysetEqual.

However, I'd like to go further and propose a change to assertQuerysetEqual
so that if no transform argument is passed, and the second argument is not
a list of strings, then transform is set to the identity function.

As far as I can tell, this would not introduce a meaningful backwards
incompatibility.

I'm willing to do the work to add code and documentation etc.

All the best,

Peter.

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


Re: Welcome email

2020-07-09 Thread Peter Inglesby
Hi folks,

Is there any moderation for posts from new users?  It can be enabled
, and I'd be
willing to be part of a team that filters posts from new users.

All the best,

Peter.

On Thu, 9 Jul 2020 at 13:59, Adam Johnson  wrote:

> I think that's a good improvement, not bikeshedding :)
>
> On Thu, 9 Jul 2020 at 13:17, Shai Berger  wrote:
>
>> Sorry for the bike-shedding, but I think the text should drop the
>> "using Django" language. The people who come here with these questions
>> clearly think of themselves as developers, not users.
>>
>> IMO It should go something like,
>>
>> Welcome to django-developers, the mailing list for discussion
>> of the development of Django itself.
>>
>> This mailing list is not for support developing apps and
>> websites with Django. For support, please follow the "Getting
>> Help" page: https://docs.djangoproject.com/en/3.0/faq/help/ .
>> This page will direct you to the django-users mailing list or
>> other resources, so you can find people who are willing to
>> support you, and to ask your question in a way that makes it
>> easy for them to answer.
>>
>> Thanks,
>>
>> The Django Community
>>
>>
>>
>> On Wed, 8 Jul 2020 11:50:16 +0100
>> Adam Johnson  wrote:
>>
>> > Okay I'm in favour. That said, there's already a banner on the groups
>> > page:
>> >
>> > This group is for the discussion of the development of Django itself.
>> > If
>> > > you want to ask questions about using Django, please post on
>> > > django-users.
>> > >
>> >
>> > Suggested wording, adapted from my templated reply:
>> >
>> > Welcome to django-developers, the mailing list for discussion of the
>> > > development of Django itself.
>> > >
>> > > This mailing list is not for support using Django. For support,
>> > > please follow the "Getting Help" page:
>> > > https://docs.djangoproject.com/en/3.0/faq/help/ . This page will
>> > > direct you to the django-users mailing list or other resources, so
>> > > you can find people who are willing to support you, and to ask your
>> > > question in a way that makes it easy for them to answer.
>> > >
>> > > Thanks,
>> > >
>> > > The Django Community
>> > >
>> >
>> > Who has access to add this? Someone from the DSF board, the ops team,
>> > or the fellows?
>> >
>> > On Mon, 6 Jul 2020 at 00:02, Ahmad A. Hussein
>> >  wrote:
>> >
>> > > +1 on this. Here's the relevant feature
>> > >  I found.
>> > >
>> > >
>> > > Ahmad
>> > >
>> > > On Sun, Jul 5, 2020 at 7:58 PM Adam Johnson  wrote:
>> > >
>> > >> I can't find a google groups feature that would allow this. Do you
>> > >> know of one? It might otherwise require a custom bot.
>> > >>
>> > >> On Sun, 5 Jul 2020 at 16:14, Arvind Nedumaran
>> > >>  wrote:
>> > >>
>> > >>> Oh I understand. I meant we could include the distinction in the
>> > >>> welcome email and possibly a link to the other list.
>> > >>>
>> > >>> That may reduce the number of people who may be looking for help
>> > >>> but end up here mistakenly?
>> > >>>
>> > >>> Get Outlook for Android 
>> > >>>
>> > >>> --
>> > >>> *From:* django-developers@googlegroups.com <
>> > >>> django-developers@googlegroups.com> on behalf of אורי
>> > >>>  *Sent:* Sunday, July 5, 2020 8:39:22 PM
>> > >>> *To:* Django developers (Contributions to Django itself) <
>> > >>> django-developers@googlegroups.com>
>> > >>> *Subject:* Re: Welcome email
>> > >>>
>> > >>> I think because this list is called Django developers and what we
>> > >>> call "Django users" are also developers who use Django. But they
>> > >>> are developers.
>> > >>>
>> > >>> אורי
>> > >>> u...@speedy.net
>> > >>>
>> > >>>
>> > >>> On Sun, Jul 5, 2020 at 5:59 PM Arvind Nedumaran
>> > >>>  wrote:
>> > >>>
>> > >>> Hey everyone,
>> > >>>
>> > >>> I notice that people who try to find support on using Django
>> > >>> mistakenly post in this list and sometime usually has to write an
>> > >>> explanation about how this is the wrong place.
>> > >>>
>> > >>> Could we possibly as a welcome email whenever someone joins the
>> > >>> group?
>> > >>>
>> > >>> Just a suggestion.
>> > >>>
>> > >>> Best,
>> > >>> Arvind
>> > >>>
>> > >>> --
>> > >>> You received this message because you are subscribed to the Google
>> > >>> Groups "Django developers (Contributions to Django itself)" group.
>> > >>> To unsubscribe from this group and stop receiving emails from it,
>> > >>> send an email to django-developers+unsubscr...@googlegroups.com.
>> > >>> To view this discussion on the web visit
>> > >>>
>> https://groups.google.com/d/msgid/django-developers/BYAPR14MB29181EBF50C845052F69E5E1A3680%40BYAPR14MB2918.namprd14.prod.outlook.com
>> > >>> <
>> https://groups.google.com/d/msgid/django-developers/BYAPR14MB29181EBF50C845052F69E5E1A3680%40BYAPR14MB2918.namprd14.prod.outlook.com?utm_medium=email&utm_

Help needed to fix hundreds of failing tests

2020-10-10 Thread Peter Inglesby
Hi folks,

I've authored PR 12417  (Fixed
31235  -- Updated
assertQuerysetEqual to compare querysets directly) which has added a new
RemovedInDjango41Warning... which causes hundreds of test failures.

Unfortunately I have no spare time at the moment to resolve these.  Would
anybody on this list like to take the PR off my hands?

Thanks!

Peter.

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


Re: Help needed to fix hundreds of failing tests

2020-10-12 Thread Peter Inglesby
Thanks Hasan for offering to help.

Either of Carles's approaches would work -- I don't have a strong view.
Making the smaller fix (ie adding transform=str every time
assertQuerysetEqual fails) would require the least thinking.  But it may
miss some good opportunities to refactor or simplify the tests.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAENJrPkeGvOTt%3DppXiRN4XoPV%2B25bgN%2BDkLyLuWfA1nRXu6qgg%40mail.gmail.com.


Ticket update ending up in gmail spam

2020-10-22 Thread Peter Inglesby
Hi folks,

An email with an update on ticket that I'm subscribed to has ended up in my
gmail spam folder:

[image: image.png]

I'm not sure what to suggest!

Peter.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAENJrP%3DkH29Yq%3D3AsMpmyYSavD884pZ%3D%2B_MCVxnn7DLv4MhnVw%40mail.gmail.com.


Re: undeclared variable appearing in django/db/models/__init__.py

2016-10-07 Thread Peter Inglesby
Hi Tim,

Disappointingly, I don't think Django's doing anything off the wall here!

When you import a package's submodule, the name of that submodule is added
to the package's namespace.  This is what allows you to put `import p.m`,
and to then to use `p.m` in your code -- module m is added to package p's
namespace.

In the Django code, we end up importing django.db.models.functions (via
django.db.models.manager and django.db.models.query)  in
django/db/models/__init__.py.  `functions` gets added to the namespace of
the package django.db.models, which Python does by adding it to the
 __init__ module's locals(), which makes `functions` available as a label
in the remainder of the code.

Note that I can't actually find the chapter and verse for how this works in
the Python docs, but I've been caught out by something similar in the past!

Hope this helps,

Peter.

On 7 October 2016 at 02:10, Tim Graham  wrote:

> I'm seeing an issue while running the Django test suite that I can't
> explain.
>
> If you add print(functions) before
> from django.db.models.manager import Manager
> in https://github.com/django/django/blob/master/django/db/
> models/__init__.py#L15, it gives name 'functions' is not defined  as I
> would expect.
>
> However, if you add the same print on the line after, it gives  'django.db.models.functions' from '/home/tim/code/django/django/
> db/models/functions/__init__.py'>. A "functions" variable is magically
> defined!
>
> Why does importing django.db.models.manager have this side effect?
> manager.py imports django.db.models.query which imports
> django.db.models.functions. If I move the functions import to an inner
> import in query.py as done in https://github.com/django/django/pull/7348,
> there's no more magic "functions" variable available in
> db/models/__init__.py.
>
> Can you explain this? I checked all the "from *" imports in
> models/__init__.py to rule that out.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django developers (Contributions to Django itself)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-developers+unsubscr...@googlegroups.com.
> To post to this group, send email to django-developers@googlegroups.com.
> Visit this group at https://groups.google.com/group/django-developers.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/django-developers/d8247cc5-e9e8-4725-9714-
> 8a30b0ebc60c%40googlegroups.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAENJrPkNusSN5kLABmLM%2BFEvUm20-HbDiC1HA5WKBLqazmmLaQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.