Creating the testing db fails (django 1.8.5)

2015-10-14 Thread Uwe Schuerkamp
Hi folks,

this is my first posting in this group, so I'm sorry in advance if I'm 
breaking any rules or missing some vital information.

My setup: 

Ubuntu Server 14.04.x
Python 2.7.6
Django 1.8.4 (updated to 1.8.5 recently) installed via "pip"
MariaDB 5.5.44

I'm trying to set up a test framework for a little internal project which 
I've been working on since the Django 1.3 days. I've recently migrated the 
project to Django 1.8.4/5 via Django 1.7, and everything appears to be 
working fine. 

Trying to set up a testing framework for the first time to get out of my 
bad "non-testing" habit and increase the test coverage above "0%" for the 
first time ever, I've run into a problem when the manage.py script tries to 
create the test database (permissions on the MySQL side are ok, i've tested 
createdb, dropping, creating and changing tables in the test db manually): 

http://pastebin.com/XDRiqaqL

I've been googling for quite some time and have tried creating the 
migrations via "--fake-initial", but nothing has helped to work around the 
problem. 

I've read it could be some foreign key problem (MariaDB 5.5.x backend), but 
I'm at a loss on how to analyze things further except for randomly 
reordering my models which seems a bit silly. 8( 

Thanks in advance for any pointers, 

Uwe

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/6d0a3eee-fa06-4ba4-b8ac-5447c073e830%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating the testing db fails (django 1.8.5)

2015-10-14 Thread Mike Dewhirst

On 14/10/2015 11:34 PM, Uwe Schuerkamp wrote:

Hi folks,

this is my first posting in this group, so I'm sorry in advance if I'm
breaking any rules or missing some vital information.

My setup:Â

Ubuntu Server 14.04.x
Python 2.7.6
Django 1.8.4 (updated to 1.8.5 recently) installed via "pip"
MariaDB 5.5.44

I'm trying to set up a test framework for a little internal project
which I've been working on since the Django 1.3 days. I've recently
migrated the project to Django 1.8.4/5 via Django 1.7, and everything
appears to be working fine.Â

Trying to set up a testing framework for the first time to get out of my
bad "non-testing" habit and increase the test coverage above "0%" for
the first time ever, I've run into a problem when the manage.py script
tries to create the test database (permissions on the MySQL side are ok,
i've tested createdb, dropping, creating and changing tables in the test
db manually):Â

http://pastebin.com/XDRiqaqL


A quick glance at pastebin indicates the error is a failure to delete 
the test database.


Can you manually delete it prior to running the tests? That would skip 
the entire section (apparently) which raises the error.


Mike



I've been googling for quite some time and have tried creating the
migrations via "--fake-initial", but nothing has helped to work around
the problem.Â

I've read it could be some foreign key problem (MariaDB 5.5.x backend),
but I'm at a loss on how to analyze things further except for randomly
reordering my models which seems a bit silly. 8(Â

Thanks in advance for any pointers,Â

Uwe

--
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...@googlegroups.com
.
To post to this group, send email to django-users@googlegroups.com
.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/6d0a3eee-fa06-4ba4-b8ac-5447c073e830%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 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/561F4E92.9030705%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.


Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp

>
> Hi Mike,
>

thanks for your quick reply.

I tried deleting the test database, but that didn't help either (actually I 
tried this several times before I posted here, I even set up a "fresh" 
production database  on my test machine and re-imported the live data in 
order to solve the problem).

All the best, 

Uwe

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/12e76866-8880-4c10-9ce3-8876d2059a7f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp
Here's some more info in case it helps: 

The "manage.py test" call seems to get as far as creating the table 
"django_migrations", then things break. The production DB has several more 
tables (25 in all) I'm not seeing in the output below, so I guess this 
issue must be related to the migrations table in some manner. 

All the best, Uwe


MariaDB [test_club300_owl]> show tables ; 
+-+
| Tables_in_test_club300_owl  |
+-+
| club300_alert   |
| club300_area|
| club300_bird|
| club300_birdcategory|
| club300_birdcategory_birdcategory_birds |
| club300_country |
| club300_location|
| club300_newsitem|
| club300_observation |
| club300_toplist |
| club300_toplist_toplist_birds   |
| club300_userprofile |
| django_migrations   |
+-+
13 rows in set (0.00 sec)




>

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/1267ddd2-b62b-4509-bd71-b95c6a844375%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating the testing db fails (django 1.8.5)

2015-10-15 Thread Uwe Schuerkamp

>
> I solved it myself... looks like I forgot to create the initial migrations 
> for the app. After running
>

python manage.py makemigrations club300
python  manage.py migrate --fake-initial

python manage.py test club300

appears to work fine. Sorry for the noise & thanks for your help!

Uwe

-- 
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...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/db479740-90cb-4a3c-b263-8b011464d5ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.