Site matching query does not exist when you try to run the tests?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
24 views
Trying to do
root@2fd625d222bb:/app# ./manage.py test Creating test database for alias 'default'... Got an error creating the test database: database "test_app" already exists Type 'yes' if you would like to try deleting the test database 'test_app', or 'no' to cancel: yes Destroying old test database for alias 'default'...

Get
__fake__.DoesNotExist: Site matching query does not exist.


>>> from django.contrib.sites.models import Site >>> Site.objects.all() ]> >>> Site.objects.first().pk 1 settings.py SITE_ID = 1


The entry in the database is that not so?
by | 24 views

2 Answers

0 like 0 dislike
So the Test database is empty, you must first create the entry, and then already to pull it off. Base in Ganga cleaned after each test.
by
0 like 0 dislike
Not sure, but MB will help the First link in Google
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
asked May 21, 2019 by apheyhys
110,608 questions
257,186 answers
0 comments
28,117 users