Reference data while testing - interesting

2023-10-05 Thread Mike Dewhirst
I have an interesting testing problem which requires someone smarter than me. I want to prove correctness of multiple outcomes from multiple regulatory computations based on, among other things, international lists of assessed chemicals and their hazards. Hazards include both human health

Re: Reference data while testing

2023-10-03 Thread Mike Dewhirst
of which are (somewhat) regularly updated when those authorities notify changes. Once an expert confirms a risk profile for a particular chemical we use a Django management command to generate a new Django test in our test harness. The objective is to run that/those tests in our regular testing

Re: Reference data while testing

2023-10-03 Thread Qayyam Hussain
ritical to unit testing. > > Fixtures are unworkable and I need to respond to the actual reference > data. > > How can i do real lookups (read-only) during tests? > > Thanks > > Mike > > > > > -- > (Unsigned mail from my phone) > > > -- > Y

Re: Reference data while testing

2023-10-03 Thread Alessandro Madruga Correia
On Mon, Oct 2, 2023 at 11:30 PM Mike Dewhirst wrote: > > This is probably in the docs so please drop me a link if you can. > > My project has fifteen or more tables of reference data which determine > how the software behaves and therefore is critical to unit testing. > > Fi

Re: Reference data while testing

2023-10-03 Thread herve bineli
Hi Mike, I will suggest you use a database framework like SQLAlchemy to access your tables' data with read-only queries. Then you use the data queried to set your test cases using a testing library like Pytest. Do let know if you have other concerns with this approach. Best Regards, BINELI

Re: Reference data while testing

2023-10-02 Thread Jun Say
more tables of reference data which determine > how the software behaves and therefore is critical to unit testing. > > Fixtures are unworkable and I need to respond to the actual reference > data. > > How can i do real lookups (read-only) during tests? > > Thanks > > Mike &

Reference data while testing

2023-10-02 Thread Mike Dewhirst
This is probably in the docs so please drop me a link if you can.My project has fifteen or more tables of reference data which determine how the software behaves and therefore is critical to unit testing.Fixtures are unworkable and I  need to respond to the actual reference data.How can i do

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Hmm, when I remove the raise CommandError statement and replace it with self.stdout.write, everything works well. This helps me to point further studies. Thx! On Wednesday, May 10, 2023 at 2:33:18 PM UTC+2 Bob Aalsma wrote: > Ah, yes, thanks. > > I hesitate to comment on "If I understood the

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Ah, yes, thanks. I hesitate to comment on "If I understood the error right." ;) Umm, my problem here is that I think I'm using the exact same *code* "manually" without errors. I think I'm also using the same *values* for the manual and test runs. So I don't understand the reason for the

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
If I understood the error right. On Wed, May 10, 2023 at 5:47 PM Vishesh Mangla wrote: > Probably this would help: > https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django > > On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users <

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
Probably this would help: https://stackoverflow.com/questions/8609192/what-is-the-difference-between-null-true-and-blank-true-in-django On Wed, May 10, 2023 at 5:45 PM 'Bob Aalsma' via Django users < django-users@googlegroups.com> wrote: > Sorry Vishesh, thanks for the quick answer but I have no

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
Sorry Vishesh, thanks for the quick answer but I have no idea what you mean. On Wednesday, May 10, 2023 at 2:00:51 PM UTC+2 Vishesh Mangla wrote: > False or True check for yourself. > > On Wed, 10 May, 2023, 17:29 Vishesh Mangla, wrote: > >> It looks like you are passing a null but null=False

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
False or True check for yourself. On Wed, 10 May, 2023, 17:29 Vishesh Mangla, wrote: > It looks like you are passing a null but null=False is not set > > On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, < > django-users@googlegroups.com> wrote: > >> I'm trying to test a django-admin

Re: testing newbie - help requested: app works, tests give errors

2023-05-10 Thread Vishesh Mangla
It looks like you are passing a null but null=False is not set On Wed, 10 May, 2023, 17:27 'Bob Aalsma' via Django users, < django-users@googlegroups.com> wrote: > I'm trying to test a django-admin command and don't understand why the > tests give errors on the code while the code works as

testing newbie - help requested: app works, tests give errors

2023-05-10 Thread 'Bob Aalsma' via Django users
I'm trying to test a django-admin command and don't understand why the tests give errors on the code while the code works as expected. I'm under the impression that the *raise CommandError* is ignored by the test, but don't understand why this would be. Please help. Running the code shows:

Re: Testing django

2023-03-16 Thread Ayush Bisht
ionTests* >>> >>> what exactly is the purpose of *path.to.settings,* I'm getting an error >>> while running the above line. >>> Can anyone please explain? >>> >>> *Error* >>> Testing against Django installed in '/home/ayush/OS/django/dja

Re: Testing django

2023-03-16 Thread Bhuvnesh Sharma
slationTests* >> >> what exactly is the purpose of *path.to.settings,* I'm getting an error >> while running the above line. >> Can anyone please explain? >> >> *Error* >> Testing against Django installed in '/home/ayush/OS/django/django' with >> up to

Re: Testing django

2023-03-16 Thread Ayush Bisht
ngs i18n.tests.TranslationTests* > > what exactly is the purpose of *path.to.settings,* I'm getting an error > while running the above line. > Can anyone please explain? > > *Error* > Testing against Django installed in '/home/ayush/OS/django/django' with up > to 8 processes > Tr

Testing django

2023-03-16 Thread Ayush Bisht
* ./runtests.py --settings=path.to.settings i18n.tests.TranslationTests* what exactly is the purpose of *path.to.settings,* I'm getting an error while running the above line. Can anyone please explain? *Error* Testing against Django installed in '/home/ayush/OS/django/django' with up to 8

Anyone testing async views with django test client?

2022-09-20 Thread 'SP' via Django users
My async CBV works when accessed through my url endpoint with REQUESTS package. But with the django test client it seems to think the database doesn't contain the information I'm trying to pull using ORM. I've confirmed that the data DOES exist in the newly recreated DB (populated with

Re: Database objects do not implement truth value testing

2022-02-24 Thread Kasper Laudrup
On 24/02/2022 16.18, Pradumn Maurya wrote: Dear Sir/Mam I just face this problem when i am using makemigrations cmd, how can i fix this. Can any one help me solve this problem? I'm fairly certain no one will be able to help you solve this problem if you don't describe it a bit more in

NotImplementedError: Database objects do not implement truth value testing or bool(). Please compare with None instead: database is not None

2022-01-21 Thread Oumar Thiombane
NotImplementedError: Database objects do not implement truth value testing or bool(). Please compare with None instead: database is not None -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

[Solved]: Unit testing migrations [Was: Related model 'company.user' cannot be resolved]

2021-07-07 Thread Mike Dewhirst
On 7/07/2021 9:56 am, Mike Dewhirst wrote: It seems I have to meddle with history and persuade the testing harness that my custom user model has been in the company app from the beginning of time. See story below. Upside is that testing will (might) start working again. Downside is I'll go

Unit testing migrations [Was: Related model 'company.user' cannot be resolved]

2021-07-06 Thread Mike Dewhirst
It seems I have to meddle with history and persuade the testing harness that my custom user model has been in the company app from the beginning of time. See story below. Upside is that testing will (might) start working again. Downside is I'll go mad. Any ideas? Thanks Mike On 6/07/2021

A/B testing recommendations

2021-04-27 Thread Andréas Kühne
Hi all, I am working on a website where we now want to do A/B testing. Now I have previously looked into this - but have never found any good packages for doing that. The landscape may have changed now then, so I was wondering if anyone has any good suggestions for A/B testing packages

Re: Testing Django User Login Form

2021-04-23 Thread lone...@gmail.com
Thank you for the reply! I will totally try this tonight! On Thursday, April 22, 2021 at 7:31:40 PM UTC-4 David Nugent wrote: > Try creating a request using RequestFactory and use that to input the > credentials. I don't think the way you are creating the form is valid. > > rf =

Re: Testing Django User Login Form

2021-04-22 Thread David Nugent
Try creating a request using RequestFactory and use that to input the credentials. I don't think the way you are creating the form is valid. rf = RequestFactory() request = rf.post('/some_mock_url', dict(username='abc', password='password')) form = AuthenticationForm(request) -- You received

Testing Django User Login Form

2021-04-18 Thread lone...@gmail.com
Hello all, I am not sure what I am doing incorrectly with the below test case information. I am simply trying to test the default authentication form of django 3.1. This test should be a good/True login test. Here is the Test case:- class TestForms(TestCase): def

Django reverse lookup fails during unit testing

2021-03-16 Thread Derek
es_site_changelist' is not a valid view function or pattern name. Is there some simple reason why reverse lookup does not work when testing? (I actually need to use it in a client post request.) Thanks Derek -- You received this message because you are subscribed to the Google Groups "Django users

Django Channels - Monitoring and Testing Performance in Prod

2021-01-05 Thread Myer Nore
I work on an app that has Django Channels 1 deployed in production with CPU-based auto-scaling. Most of the time, it works fine, but sometimes, when the site is busy and many users are utilizing the parts of our application that are channels-intensive, users are unable to utilize their

Re: Hello ! I'm having some issues in django unit testing. Is there anybody to help ?

2020-11-06 Thread Monaco investment
:59 PM To: Django users Subject: Hello ! I'm having some issues in django unit testing. Is there anybody to help ? Hello ! I'm having some issues in django unit testing. Is there anybody to help ? I'm having confusion in testing django mixins . Can anyone share his/her git with such unit t

Hello ! I'm having some issues in django unit testing. Is there anybody to help ?

2020-11-06 Thread Nilima Dahal
Hello ! I'm having some issues in django unit testing. Is there anybody to help ? I'm having confusion in testing django mixins . Can anyone share his/her git with such unit testing or have some experienced shareable codes. how do I test this ? def dispatch(self,request,*args,**kwargs

RES: testing class based generic views

2020-10-26 Thread Samuel Nogueira
I don’t know a test tutorial, but I think you can get some help in the Django docs. https://docs.djangoproject.com/en/3.1/topics/testing/tools/  -Samuel Nogueira Bacelar GitHub: https://github.com

testing class based generic views

2020-10-24 Thread Patrick Carra
Can anyone point me towards a tutorial for how to test a CreateView function? -- 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

Re: django testing: widgets

2020-10-11 Thread Dvs Khamele
Hi do you hire contract based python/django freelancer? We can help you in this and related tasks at fair prices. Reply or send email to divy...@pythonmate.com Best Regards, Divyesh Khamele, Pythonmate On Thu, 1 Oct 2020, 6:32 pm albert, wrote: > Hi > due to the impact of corona/covid19 I am

django testing: widgets

2020-10-01 Thread albert
Hi due to the impact of corona/covid19 I am working in a django-web-project. (I am a beginner to those Technologies...) At the moment I am writing tests for a django application. Basic tests for creating get- and post-request with the test server (client) are working. But now I am facing a

Django access the Default database (prod/dev) when testing and Fatal Error

2020-08-13 Thread Carlos Leite
Hello everyone, I run into a odd situation while trying to run some tests in an old project (dj 1.8) Then I tried the same on a django 3.1 and the problem is still there. # models.py # class Disco(models.Model): nome = models.CharField('disco', max_length=50) class

Exception During Testing on Windows, Python 3.8

2020-06-11 Thread Matthew Pava
I continue to receive the following exception error at every single one of my tests. I'm running Python 3.8.2 on Windows 10. Exception happened during processing of request from ('127.0.0.1', 54962) Traceback (most recent call last): File "c:\program

Testing an online payment Form using Django Keep getting Not Authenticated Error. Is it because of the Testing Credit Card numbers?

2020-04-27 Thread Ahmed Khairy
I am making a project for an online payment e-commerce I think I got everything right as am following a Tutorial Keep getting this Error: Not Authenticated Error I used the testing CC Numbers for testing purposes My question is the following codes correct and I'm getting Not Authenticated

Re: Django Testing

2020-04-10 Thread Jatin Agrawal
The main reason behind learning about Testing is to check if the views that we have written for, are generating the expected results or not. Suppose you are writing an APIView to get a list of something, then you should write a testcase to check whether that APIView is giving you the result

Re: Django Testing

2020-03-31 Thread Lunga Baliwe
rar Ahmad > wrote: > >> Hello Sir >> I have trouble in learnig Testing tutorial of Djanog Documentation. >> Can any one tell me what is the main concept of learnign test and how can >> we learn it in easiest way. >> I am waiting for reply >> >> -

Re: Django Testing

2020-03-31 Thread ekong, emmanuel
I’m having the same difficulty... On Tue, 31 Mar 2020 at 3:32 PM, Abrar Ahmad wrote: > Hello Sir > I have trouble in learnig Testing tutorial of Djanog Documentation. > Can any one tell me what is the main concept of learnign test and how can > we learn it in easiest way. &g

Django Testing

2020-03-31 Thread Abrar Ahmad
Hello Sir I have trouble in learnig Testing tutorial of Djanog Documentation. Can any one tell me what is the main concept of learnign test and how can we learn it in easiest way. I am waiting for reply -- You received this message because you are subscribed to the Google Groups "Django

Re: Testing my Django App

2020-03-23 Thread Motaz Hejaze
Delete the sqlite database and migrate again to remake it On Mon, 23 Mar 2020, 7:56 pm victor awakan, wrote: > Check your book.user_id. It shouldn’t be null. That’s what the last error > is saying. > > On Mon 23. Mar 2020 at 17.44, Ejike Enyinnaya > wrote: > >> Good day All, >> >> I am

Re: Testing my Django App

2020-03-23 Thread victor awakan
Check your book.user_id. It shouldn’t be null. That’s what the last error is saying. On Mon 23. Mar 2020 at 17.44, Ejike Enyinnaya wrote: > Good day All, > > I am currently running a test for my Django app call 'Books'. > > Anytime I run an INDEX test, I get the following error below: > > "File

Testing my Django App

2020-03-23 Thread Ejike Enyinnaya
Good day All, I am currently running a test for my Django app call 'Books'. Anytime I run an INDEX test, I get the following error below: "File "/Users/macbookpro/.local/share/virtualenvs/first_django_app-mymO4nCn/lib/python3.7/site-packages/django/db/backends/sqlite3/base.py", line 396, in

Re: Unit Testing POST request

2020-02-13 Thread onlinejudge95
st) >>>>> self.assertEqual(response.status_code, 201) >>>>> >>>> >>>> In my view, I am accessing the data through *request.data* and passing >>>> it to a serializer. >>>> >>>> In my current setting, I am g

Re: Unit Testing POST request

2020-02-13 Thread onlinejudge95
elf.request) >>>> self.assertEqual(response.status_code, 201) >>>> >>> >>> In my view, I am accessing the data through *request.data* and passing >>> it to a serializer. >>> >>> In my current setting, I am getting a 400 error message wh

Re: Unit Testing POST request

2020-02-13 Thread sachinbg sachin
gt;> >>>> response = views.blog_collection(self.request) >>>> self.assertEqual(response.status_code, 201) >>>> >>> >>> In my view, I am accessing the data through *request.data* and passing >>> it to a serializer. >&g

Re: Unit Testing POST request

2020-02-13 Thread Adam Mičuda
error message when I have >> checked that the user does not exist. >> >> Any suggestions regarding the same? >> >> Thanks, >> onlinejudge95 >> > > In case if someone needs it in the future, go and look at > *django.test.RequestFactory * >

Re: Unit Testing POST request

2020-02-12 Thread onlinejudge95
ssage when I have > checked that the user does not exist. > > Any suggestions regarding the same? > > Thanks, > onlinejudge95 > In case if someone needs it in the future, go and look at *django.test.RequestFactory * https://docs.djangoproject.com/en/3.0/topics/testing/advan

Re: Unit Testing POST request

2020-02-12 Thread onlinejudge95
Hi Guys, Any leads would be appreciated On Wed, Feb 12, 2020 at 6:22 PM onlinejudge95 wrote: > Hi Devs, > > I was implementing unit-tests in my Django project and stumbled upon the > following issue. > > I want to unit-test my POST route. I do not want to use the test client > already shipped

Unit Testing POST request

2020-02-12 Thread onlinejudge95
Hi Devs, I was implementing unit-tests in my Django project and stumbled upon the following issue. I want to unit-test my POST route. I do not want to use the test client already shipped with Django (using it in my e2e tests). I want to know how do I prepare my request object to pass to my view.

Django does not Override Settings in Template Tag Testing

2019-12-11 Thread Eray Erdin
I have actually provided quite much verbose information in Stackoverflow <https://stackoverflow.com/questions/59251954/django-does-not-override-settings-in-template-tag-testing>. I have a problem overriding settings as testing template tags. I leave this here in case you are inte

Reading the timeout value for a django cache entry (for testing)

2019-11-11 Thread guettli
We had a bug in our production system. The timeout was set incorrectly. Now I want to write a test which checks, that the value of the timeout is correct. I look at the docs and don't see a way to **read** the timeout value of a particular cache-key:

Testing the validity of a form which has inline formsets from a View subclass

2019-09-03 Thread Shaheed Haque
f form.is_valid() then form.save(commit=False)", and then proceeds to save the contents of the formsets after testing them with formset "is_valid" logic, before returning an HttpResponse. AFAICS, no exceptions are raised to signal the error. Let's say I now want to do some additional work

Re: Using plus sign in email adresses for testing purposes

2019-07-14 Thread Benjamin Boy
As I said it's for testing purposes. You can have a mailbox t...@google.com, emails to tes...@google.com are also routed to the t...@google.com mailbox. -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this grou

Re: Using plus sign in email adresses for testing purposes

2019-07-14 Thread Charlotte Wood
w.instagram.com/epiccharterschools/> <https://www.youtube.com/user/EpicCharterSchools> On Sun, Jul 14, 2019 at 6:31 AM Benjamin Boy wrote: > Im currently developping a small app. For testing purposes i want to send > emails to google with a plus sign in the email adress. > The

Using plus sign in email adresses for testing purposes

2019-07-14 Thread Benjamin Boy
Im currently developping a small app. For testing purposes i want to send emails to google with a plus sign in the email adress. The smtp backend sends the mail but i never leaves the server. What i tried: " from django.core.mail import EmailMessage email = EmailMessage('Subject', 'Body', t

Re: Different types of testing

2019-07-13 Thread Scot Hacker
On Friday, July 12, 2019 at 5:33:38 AM UTC-7, Chandrashekhar Singh wrote: > > Hello Developers, > I am curious to know what are testing methods do we use in django. Does > any has good examples or codes except django documentation.? > thanks > I don't have numbers, but subj

Different types of testing

2019-07-12 Thread Chandrashekhar Singh
Hello Developers, I am curious to know what are testing methods do we use in django. Does any has good examples or codes except django documentation.? thanks -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from

Re: Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Cristhiam Gabriel Fernández
Hi RyuCoder Should not get_object_or_404 shortcut retry 404 status code? El lunes, 10 de junio de 2019, 15:29:24 (UTC-5), RyuCoder escribió: > > Whats your question? > I failed to understand that  > > On Tue, Jun 11, 2019, 1:45 AM Cristhiam Gabriel Fernández < > cristh...@gmail.com > wrote: >

Re: Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Chetan Ganji
Whats your question? I failed to understand that  On Tue, Jun 11, 2019, 1:45 AM Cristhiam Gabriel Fernández < cristhiang...@gmail.com> wrote: > Hi Django super heroes > > I'm making of test cases for my simple Django application. When I test a > view with get_object_or_404 shortcut it returns

Testing - get_object_or_404 returns 200 status code

2019-06-10 Thread Cristhiam Gabriel Fernández
Hi Django super heroes I'm making of test cases for my simple Django application. When I test a view with get_object_or_404 shortcut it returns 200 status code. def my_view(self, request): obj_id = request.POST.get('id') obj = get_object_or_404(MyModel, pk=id) # Test case ...data =

testing automl vision

2019-04-23 Thread jc jeth
im getting an error when running the python predict.py scripts. it returns "google.api_core.exceptions.ServiceUnavailable: 503 Deadline Exceeded" -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop

Re: testing API

2019-04-22 Thread Jani Tiainen
Hi, DRF does have built-in API viewer. To enable that you need to add rest_framework app in your INSTALLED_APPS so it can find necessary templates for showing. On Tue, Apr 23, 2019 at 7:15 AM Shubham Joshi wrote: > I have created the custom model authentication in django rest , so far I > dont

testing API

2019-04-22 Thread Shubham Joshi
I have created the custom model authentication in django rest , so far I dont have front end , so my question is , Im I done with the API, since on browser it gives an error TemplateDoesNotExist at / rest_framework/api.html that of course due to I dont have template, in postmen its giving {

Re: Unit-Testing Django Views

2019-03-30 Thread Jorge Gimeno
t;>> 3. Wiping out the csrf token parts from both HTML before comparing them. >>> >>> On Thu, 28 Mar 2019, 23:54 Simon Charette, wrote: >>> >>>> This is effectively failing because of a mechanism added in 1.10 to >>>> protect >>>> a

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
re comparing them. >> >> On Thu, 28 Mar 2019, 23:54 Simon Charette, wrote: >> >>> This is effectively failing because of a mechanism added in 1.10 to >>> protect >>> against BREACH attacks[0] by salting the CSRF token. >>> >>> I'm not aware

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
lting the CSRF token. >> >> I'm not aware of any way to disable this mechanism but testing against the >> exact HTML returned from a view seems fragile. >> >> I suggest you use assertContains[1] (with or without html=True) and >> assertTemplateUsed[2] instead. >&

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
ation >>> 3. Wiping out the csrf token parts from both HTML before comparing them. >>> >>> On Thu, 28 Mar 2019, 23:54 Simon Charette, wrote: >>> >>>> This is effectively failing because of a mechanism added in 1.10 to >>>> protect

Re: Unit-Testing Django Views

2019-03-28 Thread Chetan Ganji
>> This is effectively failing because of a mechanism added in 1.10 to >>> protect >>> against BREACH attacks[0] by salting the CSRF token. >>> >>> I'm not aware of any way to disable this mechanism but testing against >>> the >>> exa

Re: Unit-Testing Django Views

2019-03-28 Thread Chetan Ganji
u, 28 Mar 2019, 23:54 Simon Charette, wrote: > >> This is effectively failing because of a mechanism added in 1.10 to >> protect >> against BREACH attacks[0] by salting the CSRF token. >> >> I'm not aware of any way to disable this mechanism but testing agains

Re: Unit-Testing Django Views

2019-03-28 Thread Aldian Fazrihady
: > This is effectively failing because of a mechanism added in 1.10 to protect > against BREACH attacks[0] by salting the CSRF token. > > I'm not aware of any way to disable this mechanism but testing against the > exact HTML returned from a view seems fragile. > > I suggest you

Re: Unit-Testing Django Views

2019-03-28 Thread Simon Charette
This is effectively failing because of a mechanism added in 1.10 to protect against BREACH attacks[0] by salting the CSRF token. I'm not aware of any way to disable this mechanism but testing against the exact HTML returned from a view seems fragile. I suggest you use assertContains[1

Unit-Testing Django Views

2019-03-28 Thread OnlineJudge95
I am trying to unit test my index view. One unit-test that I have written is testing whether the index view returns correct HTML or not by comparing the input received through django.template.loader.render_to_string the unit-test fail with the following traceback python manage.py test Creating test da

Re: Preparing for 2.2LTS - testing for Deprecation Warnings

2019-01-17 Thread Dan Davis
I will then try like this in my manage.py: if len(sys.argv)>1 and sys.argv[1] = 'test': warnings.filterwarnings(...) Thanks, -Dan On Thu, Jan 17, 2019 at 1:08 PM Simon Charette wrote: > You can use the category kwarg of filterwarnings[0] to pass the Django > deprecation >

Re: Preparing for 2.2LTS - testing for Deprecation Warnings

2019-01-17 Thread Simon Charette
You can use the category kwarg of filterwarnings[0] to pass the Django deprecation warning classes. They can be found in the django.utils.deprecation module. (e.g. RemovedInDjango30Warning). Cheers, Simon [0]

Preparing for 2.2LTS - testing for Deprecation Warnings

2019-01-17 Thread Dan Davis
PYTHONWARNINGS=error is too much. How can I call warnings.filterwarnings() to make all *Django* DeprecationWarnings into errors? -- 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,

Re: Problem with testing on Travis CI

2019-01-16 Thread אורי
tru...@konk.org> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA512 > > On Wed, Jan 16, 2019 at 09:11:47AM +0200, אורי wrote: > > Hi, > > > > I recently have problems with testing my project on Travis CI. Tests > > started to fail 2 da

Re: Problem with testing on Travis CI

2019-01-16 Thread Michal Petrucha
-BEGIN PGP SIGNED MESSAGE- Hash: SHA512 On Wed, Jan 16, 2019 at 09:11:47AM +0200, אורי wrote: > Hi, > > I recently have problems with testing my project on Travis CI. Tests > started to fail 2 days ago. The error message is > `psycopg2.OperationalError: FATAL: databas

Problem with testing on Travis CI

2019-01-15 Thread אורי
Hi, I recently have problems with testing my project on Travis CI. Tests started to fail 2 days ago. The error message is `psycopg2.OperationalError: FATAL: database "speedy" does not exist` and I don't know why. It seems to me that the first test which fail for this reason is http

Re: Django unit testing and pk's changing

2018-10-24 Thread David
The issue was my using incorrect def get_absolute_url's in my model My error. On Wednesday, 24 October 2018 12:24:07 UTC+1, David wrote: > > Hi > > When I run tests on my app they run through fine. > > When I run tests just using "manage.py test" the app mentioned above > contains

Django unit testing and pk's changing

2018-10-24 Thread David
Hi When I run tests on my app they run through fine. When I run tests just using "manage.py test" the app mentioned above contains failures. Example code: def test_lumpsum_get_absolute_url(self): lumpsum = LumpSum.objects.get() self.assertEquals(lumpsum.get_absolute_url(),

Re: How do I patch django.core.mail.send_mail for testing?

2018-08-23 Thread scloutier
I solved the problem by wrapping the imports of the test-file inside a context manager, as follow: with patch('django.core.mail.send_mail') as mocked_send_mail: from ModuleToTest.File import functionToTest That forced the patch to occur before the tested function was actualy imported. --

Re: Setting up a system for testing by users (tables are tables?)

2018-08-14 Thread guettli
Am Montag, 13. August 2018 18:12:03 UTC+2 schrieb Mikhailo Keda: > > 1. take a dump of production db > 2. remove/anonymize all sensitive or unneeded data (you can use django > admin or sql or python script) > 3. reduce amount of data if needed > 4. take a git branch with fixes > 5. make sure

Re: Setting up a system for testing by users (tables are tables?)

2018-08-13 Thread Mikhailo Keda
1. take a dump of production db 2. remove/anonymize all sensitive or unneeded data (you can use django admin or sql or python script) 3. reduce amount of data if needed 4. take a git branch with fixes 5. make sure there are no sensitive data in your code -- You received this message because

Re: Setting up a system for testing by users (tables are tables?)

2018-08-11 Thread Derek
*The users who should do the testing say "The new system should be like the production system."* You need to let them know ASAP that that is very unlikely to be the case, unless you are using exactly the same tools. You can probably provide similar functionality. Otherwise you are

Re: Setting up a system for testing by users (tables are tables?)

2018-08-10 Thread guettli
I see: no reply. Why? Am Mittwoch, 18. Juli 2018 11:45:00 UTC+2 schrieb guettli: > > I have a task which looks simple at the first sight: > > Setting up a system for testing by users. > > In my case it is a custom issue tracking system. > > The users who should do

Re: response.status 404 testing problem

2018-08-06 Thread Mike Dewhirst
Had a thought overnight ... maybe the 301 (permanently redirected) is because the staging server is using https and the server redirects from http to https. I'll start looking there. If anyone has any advice on best practice for this I'd love to hear it. Thanks Mike On 6/08/2018 2:08 PM,

Re: response.status 404 testing problem

2018-08-05 Thread Mike Dewhirst
Forgot to mention ... dev = Django 1.11.15, Python 3.6 and 2.7 on Windows 10 staging = Django 1.11.15, Python 2.7 on Ubuntu 16.04 (no GUI) Apache 2.4 Sorry Mike On 6/08/2018 1:44 PM, Mike Dewhirst wrote: I have a test which succeeds in development but fails with Apache in staging ... Here

response.status 404 testing problem

2018-08-05 Thread Mike Dewhirst
I have a test which succeeds in development but fails with Apache in staging ... Here is the test ...     def test_course_view_not_found_status_code(self):         # no course exists with pk of 99     response = self.client.get(reverse('course:course_view', kwargs={'pk': 99}))    

Setting up a system for testing by users (tables are tables?)

2018-07-18 Thread guettli
I have a task which looks simple at the first sight: Setting up a system for testing by users. In my case it is a custom issue tracking system. The users who should do the testing say "The new system should be like the production system." If this would be true, then du

queryset appears empty in debugger during testing, but not in console

2018-06-18 Thread mccc
Hello, I'm testing REST APIs with rest_framework.test.APITestCase, using their client for making requests and model_mommy for creating objects in the setUp() method. The general working is quite simple: the view is supposed to fetch a User and an object, and assign permissions for the former

Definitive (or any) guide to testing Django admin actions with intermediate pages?

2018-05-28 Thread Derek
o messages framework. ** for purpose of this question, its safe to assume that all logic for the action is included in it as a single whole. Any help with this is appreciated - its the one part of testing that just eludes me. Derek -- You received this message because you are subscribed to the Google G

Re: Unit testing models.py

2018-05-14 Thread Melvyn Sopacua
Hi Mark, On zondag 13 mei 2018 18:11:07 CEST Mark Phillips wrote: > What should be unit tested in models.py? I assume the storing of data and > retrieving of data from the database does not need to be tested, as I > further assume django has a full set of tests for those operations. You should

Re: Unit testing models.py

2018-05-14 Thread 'Anthony Flury' via Django users
I would agree with that - test any custom functionality - * Custom methods (including __str__ and __repr__) * custom managers * Triggers (that maybe save custom fields on update) * validations - testing to ensure that the right validation is performed on that field - i.e. you linked

Re: Unit testing models.py

2018-05-13 Thread Jani Tiainen
t;m...@phillipsmarketing.biz> wrote: > What should be unit tested in models.py? I assume the storing of data and > retrieving of data from the database does not need to be tested, as I > further assume django has a full set of tests for those operations. > > I can see testing these parts o

Unit testing models.py

2018-05-13 Thread Mark Phillips
What should be unit tested in models.py? I assume the storing of data and retrieving of data from the database does not need to be tested, as I further assume django has a full set of tests for those operations. I can see testing these parts of models.py * All custom methods * Labels for all

Re: [django-channels] Testing events from post_save signal

2018-02-25 Thread Tomáš Ehrlich
Kudos for you and all contributors! It’s really amazing. I’m going to send few PRs to django-channels as a payback :) Cheers, Tom > 25. 2. 2018 v 19:46, Andrew Godwin <and...@aeracode.org>: > > No problem - glad everything else seems to work alright! Getting async > te

  1   2   3   4   5   6   7   8   9   10   >