django-tests Questions

1

Solved

I am using django-rest-auth for authentication and using token provided by it for authorization. I have use some permission_class also provided by django-rest. I have folloging in views.py before m...

3

Solved

I am using django for a webapp and I'm using docker to deploy it. I need to test it in the container with selenium. I'm using selenium grid for testing. In order to connect with the liveserver on t...
Bocock asked 19/12, 2017 at 12:33

2

Django 1.9.6 I'd like to write some unit test for checking redirection. Could you help me understand what am I doing wrongly here. Thank you in advance. The test: from django.test import Test...
Retral asked 31/5, 2016 at 18:58

2

I have a Django unit test class that is based on django_webtest.WebTest, and I can't find a proper way to set a session variable during the test. I have tried the following, but I don't work from...
Commix asked 5/7, 2016 at 13:48

2

I want to write an abstract model mixin, that I can use to make OneToOne - relations to the user model. Here is my code: from django.conf import settings from django.db import models class Usera...

1

Solved

Using coverage to look what has to be tested, and coverage shows that next to this has to be tested: send_alert.apply_async() I know it is celery task, but is there any way to test the line of cod...

1

Solved

Running a test on a url returns 302 instead of 200. Yet testing the same urls in production with a redirect tester returns 200. Not really sure what's going on. tests.py def test_detail(self): r...
Fructidor asked 7/12, 2017 at 13:21

3

Solved

How do I use GenericRelations in Django unit testing? I have read and tried countless suggestions on the internets to no avail. This one was promising Problems with contenttypes when loading a f...
Birdlime asked 21/3, 2014 at 15:33

6

We are using Django 1.4 with PostgreSQL on Ubuntu 12.04. We have many tests, and the problem is that running the tests is very slow, I think because for each test the database is created from scrat...

1

Solved

I'm using Django 1.8 and Python 3.5. I have a view method I would love to test. I am supplying the self.client.get method with the data but it fails to validate the form. what am I doing wrong? Thi...
Illogicality asked 6/3, 2017 at 14:43

1

Solved

I have a routing rule in my Django app for downloads that redirect to a external CDN. I am now writing tests for my app, and I want to test that the route does successfully redirect to the configur...
Duster asked 9/12, 2014 at 23:27

1

Solved

I'd like to invoke celery tasks synchronously during my Django tests without need to run celery worker. To achieve this I have specified CELERY_ALWAYS_EAGER=True in my settings.py but it doesn't se...
Froe asked 21/11, 2016 at 14:23

1

Solved

I am new to unit testing so I have no idea what I am doing wrong. I use python2.7 with Django1.8 When I run python manage.py test myapp --keepdb I get =========================================...
Hensel asked 19/1, 2016 at 12:14

1

Solved

According to the Django docs regarding tests, the --keepdb flag will preserve the the test database for future runs. https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---k...
Mixie asked 8/7, 2015 at 9:16

2

Solved

I am able to reach a local address through my web browser (http://127.0.0.1:8983/solr) to see the Solr Admin (search webapp). However, through the Django (1.7) test client I get: >>> fr...
Particularize asked 3/4, 2015 at 2:7

2

Solved

I want to fire up the django shell with a temporary database (like what's done when doing django tests) Is there any command like: python manage.py testshell where I can create a bunch of bogus...
Freemon asked 1/6, 2014 at 1:57

1

Solved

I'm writing unit tests using Django 1.7 with Python 3.4. The form below validates fine when the file_data element is commented out. With the file_data included it doesn't validate and the test fail...
Medardas asked 1/10, 2014 at 12:48

1

Solved

So, I have created a custom pipeline for saving user's social profile data fetched from extra_data attribute of the user.social_auth model. I have thoroughly tested it, but manually. How do I au...
Arianearianie asked 7/8, 2014 at 22:23

2

Solved

Is there a way to check that two lists of objects are equal in django tests. lets say I have some model: class Tag(models.Model): slug = models.SlugField(max_length=50, unique=True) def __unico...
Zoilazoilla asked 2/6, 2014 at 4:8

1

I have a bunch of unit test files, all of which consist of django.test.TestCase classes. Wrote myself a little shell script to uncomment/comment test file imports in my __init__.py file, so I can ...
Sherrell asked 27/2, 2013 at 23:47

2

Solved

I've the following filter in my admin.py file: class parentCategoryFilter(admin.SimpleListFilter): title = 'parent category' parameter_name = 'parent_category' def lookups(self, request, model...
Eclair asked 25/5, 2013 at 15:57

© 2022 - 2024 — McMap. All rights reserved.