Re: testing signal with django allauth

2024-09-25 Thread jameel saidu
alled Allah. And I cannot get it right :/ >> >> On Monday 23 September 2024 at 13:44:21 UTC+1 RANGA BHARATH JINKA wrote: >> >>> In Django, when using `TestCase` for testing views, CSRF tokens are >>> indeed not necessary since the test client does not enforce CSRF &

Re: testing signal with django allauth

2024-09-25 Thread Gabriel Soler
e: > >> In Django, when using `TestCase` for testing views, CSRF tokens are >> indeed not necessary since the test client does not enforce CSRF >> protection. However, if you're testing forms directly (like a `ModelForm`), >> you generally don’t need to provide a CSRF

Re: testing signal with django allauth

2024-09-23 Thread RANGA BHARATH JINKA
In Django, when using `TestCase` for testing views, CSRF tokens are indeed not necessary since the test client does not enforce CSRF protection. However, if you're testing forms directly (like a `ModelForm`), you generally don’t need to provide a CSRF token either, as the form itself doe

Re: testing signal with django allauth

2024-09-23 Thread Gabriel Soler
>>> def test_form_valid(self): >>> form_invalid = StyleForm(data={"name": "Computer", "price": 400.1234}) >>> self.assertFalse(form_invalid.is_valid()) >>> form_valid = StyleForm(data=self.data) >>> self.assertTrue(form_valid

Re: testing signal with django allauth

2024-09-23 Thread RANGA BHARATH JINKA
client.session['linked'],"false") >> self.assertContains(response,"Compassionate") >> >> def test_login_form_is_valid(self): >> login_valid = LoginForm(data=self.login_data) >> self.assertTrue(login_valid.is_valid()) >> def test_login_aft

Re: testing signal with django allauth

2024-09-23 Thread RANGA BHARATH JINKA
n_valid = LoginForm(data=self.login_data) > self.assertTrue(login_valid.is_valid()) > def test_login_after_test(self): > self.client.logout() > response = self.client.post('/profile_test/',self.data, follow=True) > self.assertEqual(self.client.session['linked'],"f

Re: testing signal with django allauth

2024-09-23 Thread Gabriel Soler
e_test/',self.data, follow=True) self.assertEqual(self.client.session['linked'],"false") response = self.client.post(reverse('account_login'),data=self.login_data) #self.assertRedirects(response=response,expected_url='/') #self.client.login(username='

testing signal with django allauth

2024-09-21 Thread Gabriel Soler
Hi all, Thanks for reading. I am at a stage where I am needing to do my testing, and its is hard! I managed to add a function after sign up and log in, using the signals of allauth. As I am trying to add my tests as I work, I have added a little change to the Session, to mark if my functions

Re: Heroku testing

2024-06-23 Thread Reddy Tintaya
-testing-database-between-test-runs Long answer, do you really need to run tests on heroku?: Running your tests on the same environment you have the production application is not a common approach, I don’t think you have enough reasons to do this. Usually you run your test in a different

Heroku testing

2024-06-23 Thread Gabriel Soler
issue. I saw in a Ruby section the possibility of having a Dyno dB only for testing but couldn't find it. Another option seems to connect to the current database with some risks. A third option is to have a custom test database on its own. I don't know how to do this in Django form, p

Re: Call for Testing: Connection Pooling PR for Django Oracle

2024-05-09 Thread Benjamini Athanas
g heavy database traffic. > > We're inviting members of the Django community to participate in testing > this PR. > > > Your feedback and testing are invaluable in ensuring the reliability, > efficiency, and compatibility of this feature across various Django > projects

Call for Testing: Connection Pooling PR for Django Oracle

2024-05-06 Thread suraj shaw
ction pooling to Django's Oracle backend. This enhancement promises to bring notable improvements in performance and scalability, particularly for applications handling heavy database traffic. We're inviting members of the Django community to participate in testing this PR. Your feedb

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
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
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 > > > > > -- > (Unsigned mail from my phone) > > > -- &

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-02 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, B

Re: Reference data while testing

2023-10-02 Thread Jun Say
re 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 rea

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 err

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 differe

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 is

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 co

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 expect

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
nslationTests* >>> >>> 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/ayus

Re: Testing django

2023-03-16 Thread Bhuvnesh Sharma
.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'

Re: Testing django

2023-03-16 Thread Ayush Bisht
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

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'

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 fixtur

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 detail

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'

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

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? Or if

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 = RequestFactory(

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 thi

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 test_

Django reverse lookup fails during unit testing

2021-03-16 Thread Derek
.NoReverseMatch: Reverse for 'locales_site_changelist' not found. 'locales_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 Dere

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 websocke

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

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,*arg

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 django-users+unsubscr...@googlegr

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 wo

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 file

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 Musica

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 fil

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 Authenti

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

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 currentl

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 e

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 gett

Re: Unit Testing POST request

2020-02-13 Thread onlinejudge95
ion(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. >>> >>> In my current setting, I am getting a 400 error messa

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/advanced

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: https://docs.djangoproject.com/en/2.2/topi

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

2019-09-03 Thread Shaheed Haque
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 addition

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

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',

Re: Different types of testing

2019-07-12 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

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 this

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 20

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 receiving

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 { "det

Re: Unit-Testing Django Views

2019-03-30 Thread Jorge Gimeno
to the >>> second HTML generation >>> 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 t

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
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 >>> against BREACH attacks[0] by salting the CSRF to

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
;> 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] (with or without html=True) and

Re: Unit-Testing Django Views

2019-03-30 Thread Test Bot
t HTML generation to the >>> second HTML generation >>> 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

Re: Unit-Testing Django Views

2019-03-28 Thread Chetan Ganji
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 mechanis

Re: Unit-Testing Django Views

2019-03-28 Thread Chetan Ganji
omparing 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 of any way to disabl

Re: Unit-Testing Django Views

2019-03-28 Thread Aldian Fazrihady
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

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] (wi

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

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] https://docs.python.org/3/library/warnings.html?highlight=filterwarnings#warnings.fi

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: database &q

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

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

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 th

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 you

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

  1   2   3   4   5   6   7   8   9   10   >