Re: Fixtures for django auth groups

2019-12-04 Thread Arulselvam K
I solved the issue, Thanks lot Tim Grahma. Regards, Arul On Tue, 3 Dec 2019 at 22:41, Tim Graham wrote: > Take a look at > https://docs.djangoproject.com/en/stable/howto/initial-data/. > > On Tuesday, December 3, 2019 at 10:31:01 AM UTC-5, Arulselvam K wrote: >> >> I wan

Re: Fixtures for django auth groups

2019-12-03 Thread Tim Graham
Take a look at https://docs.djangoproject.com/en/stable/howto/initial-data/. On Tuesday, December 3, 2019 at 10:31:01 AM UTC-5, Arulselvam K wrote: > > I want to create fixtures for auth groups to get some preloaded auth > groups. Kindly educate me on how to create fixtures fixtures for

Fixtures for django auth groups

2019-12-03 Thread Arulselvam K
I want to create fixtures for auth groups to get some preloaded auth groups. Kindly educate me on how to create fixtures fixtures for built in django models Thanks and regards, Arulselvam K -- You received this message because you are subscribed to the Google Groups "Django users"

Re: Problem with loaddata fixtures

2019-10-18 Thread Mike Dewhirst
On 19/10/2019 1:37 am, Seba Rossi wrote: Hello there i was trying to migrate my database from SQLite to PostgreSQL following the docs steps but it seems that i encountered a problem wich i can't resolve. I think dumpdata and loaddata  are for fixtures used in unit tests and not for migr

Problem with loaddata fixtures

2019-10-18 Thread Seba Rossi
Hello there i was trying to migrate my database from SQLite to PostgreSQL following the docs steps but it seems that i encountered a problem wich i can't resolve. I have a base model called Producto wich has no dependencies. I have another model called Preaprobado that has the following field:

Re: Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-06 Thread Mike Dewhirst
th data not used in any tests. Considering that tests should be run with known data, if you excluded all models you would be able to put test data in any/every model. You probably don't want (in most cases) to fetch existing relationships via fixtures. An exception t

Re: Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-06 Thread Andrew Wrigley
d in any tests. > Considering that tests should be run with known data, if you excluded > all models you would be able to put test data in any/every model. You > probably don't want (in most cases) to fetch existing relationships via > fixtures. An exception to this is unchanging

Re: Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-05 Thread Mike Dewhirst
data, if you excluded all models you would be able to put test data in any/every model. You probably don't want (in most cases) to fetch existing relationships via fixtures. An exception to this is unchanging reference data for example cities and postcodes or countries and currencies. Here

Fixtures: core.serializers.sort_dependencies sorts models in the wrong order for FK constraints

2018-05-04 Thread Andrew Wrigley
Hi all, I'm trying to dump a database fixture, and load it again to run tests. When I run `python manage.py test`, I get: > IntegrityError: Problem installing fixtures: insert or update on table > "publisher_journaldupextid" violates f

Re: Initial data with migrations vs fixtures

2016-12-01 Thread Tim Graham
e latest release (well, we're at 1.7 > now, but that's the end goal anyway) and replacing South migrations > with Django migrations. > > It looks like that fixtures are no longer thought of as the correct > way of providing initial data. Is this because Run{SQL,Python} can &

Initial data with migrations vs fixtures

2016-12-01 Thread 'Tom Evans' via Django users
Hi all We're moving a project over to the latest release (well, we're at 1.7 now, but that's the end goal anyway) and replacing South migrations with Django migrations. It looks like that fixtures are no longer thought of as the correct way of providing initial data. Is this

Re: Loading fixtures inside a transaction

2016-08-03 Thread Simon Charette
I believe it already does[1] as it is a requirement to support forward references. Cheers, Simon [1] https://github.com/django/django/blob/5c63b3e5a797102d915e1683971517f747a28013/django/core/management/commands/loaddata.py#L68-L69 Le mercredi 3 août 2016 15:42:23 UTC-4, th...@copperleaf.com a

Loading fixtures inside a transaction

2016-08-03 Thread thauk
Is it possible to have the `loaddata` manage command use a transaction when loading a fixture? -- 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+unsu

Re: Fixtures won't load twice in same testcase

2016-05-12 Thread Rich Rauenzahn
On Friday, May 6, 2016 at 4:11:42 AM UTC-7, Alasdair Nicol wrote: > > >> >> But In this particular run I'm currently tracing, rich is already in the >> db (as the only entry) as pk=5 (via fixture loading process). For one, >> this tells me the sequence generators aren't always resetting betwe

Re: Fixtures won't load twice in same testcase

2016-05-12 Thread Rich Rauenzahn
On Thursday, May 5, 2016 at 4:22:11 PM UTC-7, Mike Dewhirst wrote: > > Are you using setUp() and tearDown() as class methods in your test class? > > No, the code was using setUpClass(), which is a classmethod. -- You received this message because you are subscribed to the Google Groups "Djan

Re: Fixtures won't load twice in same testcase

2016-05-06 Thread Alasdair Nicol
Hi Rich, Regarding a couple of things you mentioned on Django-developers: On Thursday, 5 May 2016 19:20:16 UTC+1, Rich Rauenzahn wrote: > > > Thanks, Tim. > > Unfortunately I can't move past Django 1.7 yet -- dependencies. I've been > marching my way up one revision at a time hopefully up to 1.

Re: Fixtures won't load twice in same testcase

2016-05-05 Thread Mike Dewhirst
On 6/05/2016 8:42 AM, Rich Rauenzahn wrote: I've been tracing into django core code, and it looks to me that I have a case where the fixture has a auth.User(username=rich) with a pk=1 in the fixture. Â But sometimes as the User fixture with pk=1 is being added (updated?) through Model._save_tabl

Re: Fixtures won't load twice in same testcase

2016-05-05 Thread Rich Rauenzahn
I've been tracing into django core code, and it looks to me that I have a case where the fixture has a auth.User(username=rich) with a pk=1 in the fixture. But sometimes as the User fixture with pk=1 is being added (updated?) through Model._save_table(), the same User with pk=5 is already in

Fixtures won't load twice in same testcase

2016-05-04 Thread Rich Rauenzahn
r less... class Foo(TestCase): # and I've tried TransactionTestCase fixtures = ['accounts.json', 'config.json', 'runtimedata.json'] def test1(self): pass # yes, literally. def test2(self): pass # literally, pass right now If I split te

Approaches for sharing development fixtures across teams

2016-03-23 Thread pjotr
Hi, We have been struggling with sharing development fixtures between each other. Keeping media files, and db in sync has been problematic for us. We started by just storing zip files containing media files directory, and a pg_dump of the database. Fine. But then we started to swap branches

Django tests on postgresql with fixtures

2016-03-09 Thread Dheerendra Rathor
According to django testing docs - database is flushed after each TestCase. It is working fine when I'm using sqlite for testing. But database is not flushed when using postgresql and testcases are failing since it is trying to load fixtures which have been loaded in previous TestCase.

Re: null datetime field and json fixtures

2016-02-25 Thread Malik Rumi
--traceback Raise on CommandError exceptions > --no-colorDon't colorize the command output. > --database DATABASE Nominates a specific database to load fixtures > into. > Defaults to the "default" da

Re: null datetime field and json fixtures

2016-02-24 Thread James Schneider
ct". --traceback Raise on CommandError exceptions --no-colorDon't colorize the command output. --database DATABASE Nominates a specific database to load fixtures into. Defaults to the "default" database. --app AP

Re: null datetime field and json fixtures

2016-02-24 Thread Malik Rumi
I am pursuing the debug option now to see what I can learn. On Fri, Feb 19, 2016 at 5:29 PM, Michal Petrucha < michal.petru...@konk.org> wrote: > On Fri, Feb 19, 2016 at 10:20:42AM -0600, Malik Rumi wrote: > > In [1]: import uuid > > > > In [2]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74

Re: null datetime field and json fixtures

2016-02-24 Thread Malik Rumi
Sorry to have dropped out for a few days there. James, when I said I only have this one I should clarify. I had 90 records I wanted to put into one model, and 1 record to put into another. The 1 record is linked to by a fk from the other 90. For whatever reason, I was able to put the single record

Re: null datetime field and json fixtures

2016-02-19 Thread Michal Petrucha
On Fri, Feb 19, 2016 at 10:20:42AM -0600, Malik Rumi wrote: > In [1]: import uuid > > In [2]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74') > Out[2]: UUID('61877565-5fe5-4175-9f2b-d24704df0b74') > > BUT > > In [3]: uuid.UUID4('61877565-5fe5-4175-9f2b-d24704df0b74') >

Re: null datetime field and json fixtures

2016-02-19 Thread James Schneider
> > The only uuid currently in this fixture is the one I got from Django when > I put another model (only one row) in with a fixture (no date field) and it > worked. I needed the uuid of that object to put into the foreign key of the > model I am having trouble with now. > > > So I was sniffing aro

Re: null datetime field and json fixtures

2016-02-19 Thread Malik Rumi
In [1]: import uuid In [2]: uuid.UUID('61877565-5fe5-4175-9f2b-d24704df0b74') Out[2]: UUID('61877565-5fe5-4175-9f2b-d24704df0b74') BUT In [3]: uuid.UUID4('61877565-5fe5-4175-9f2b-d24704df0b74') --- AttributeError

Re: null datetime field and json fixtures

2016-02-18 Thread James Schneider
On Thu, Feb 18, 2016 at 8:20 AM, Malik Rumi wrote: > James, > > I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the > csv to json. > Looks legit. I'll just assume it creates syntactically correct JSON, otherwise it probably wouldn't last long as a public package. > > On We

Re: null datetime field and json fixtures

2016-02-18 Thread Malik Rumi
UPDATE: I went back and looked at the Python module documentation you referenced again. Although it is true that the examples at the top of the page don't strictly match the 8-4-4-4-12 format, those at the bottom of the page do. Furthermore, it seems clear that the uuid.UUID() function is a Pyth

Re: null datetime field and json fixtures

2016-02-18 Thread Michal Petrucha
On Thu, Feb 18, 2016 at 08:20:57AM -0800, Malik Rumi wrote: > James, > > I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the > csv to json. > > On Wednesday, February 17, 2016 at 7:05:59 PM UTC-6, James Schneider wrote: > > > > > >> The uuid.UUID() function is somewhat forgi

Re: null datetime field and json fixtures

2016-02-18 Thread Malik Rumi
James, I used csvkit csvkit.readthedocs.org/en/latest/index.html to convert the csv to json. On Wednesday, February 17, 2016 at 7:05:59 PM UTC-6, James Schneider wrote: > > >> The uuid.UUID() function is somewhat forgiving when it comes to providing > values. See https://docs.python.org/3.5/lib

Re: null datetime field and json fixtures

2016-02-17 Thread James Schneider
string') > > ValueError: Problem installing fixture > '/home/malikarumi/Projects/cannon/jamf/essell/fixtures/test22byhand.json': > badly formed hexadecimal UUID string > > The only uuid currently in this fixture is the one I got from Django when > I put another mod

Re: null datetime field and json fixtures

2016-02-17 Thread Malik Rumi
@Tetuoan2:~/Projects/cannon/jamf$ python manage.py loaddata essell/fixtures/test22byhand.json Traceback (most recent call last): File "/home/malikarumi/Projects/cannon/local/lib/python2.7/site-packages/django/core/serializers/python.py", line 174, in Deserializer raise base.Dese

Re: null datetime field and json fixtures

2016-02-17 Thread James Schneider
n there, it is rejected as not valid date > format. Therefore, it seems there is no way to do this through a fixture. > My question: Is this correct? If so, is there any alternative to doing it > all manually? Thanks. > When you are talking fixtures, everything I just mentioned ab

Re: null datetime field and json fixtures

2016-02-17 Thread Avraham Serour
Try not setting any value to the field, it should be saved with the default value On Wed, Feb 17, 2016, 2:35 AM Malik Rumi wrote: > There are a ton of answers to this question out there - if you can wade > through all the ones that refer to forms and not models. The consensus > seems to be that

null datetime field and json fixtures

2016-02-16 Thread Malik Rumi
There are a ton of answers to this question out there - if you can wade through all the ones that refer to forms and not models. The consensus seems to be that datetime has to be set to both blank=true and null=true. And when I put in one test row of data manually through the admin, I could lea

Re: Problem installing fixtures

2016-02-13 Thread WST
he process until it stops occuring. Then, the following error appeared. django.db.utils.IntegrityError: Problem installing fixtures: insert or update on table "auth_permission" violates foreign key constraint "auth_permiss_content_type_id_2f476e4b_fk_django_content_type_id" DE

Re: Problem installing fixtures

2016-02-11 Thread Carlos Leite
ms) > File > "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", > line 64, in execute > return self.cursor.execute(sql, params) > File "/usr/local/lib/python2.7/dist-packages/django/db/utils.py", line > 95, in __exit__ > six.reraise(

Problem installing fixtures

2016-02-10 Thread WST
s.py", line 95, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 62, in execute return self.cursor.execute(sql) django.

Problem installing fixtures

2016-02-10 Thread WST
kages/django/db/utils.py", line 95, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "/usr/local/lib/python2.7/dist-packages/django/db/backends/utils.py", line 62, in execute return self.cursor.execute(sql) django.

Re: settings.py variables in fixtures

2015-12-28 Thread Salvatore Scaramuzzino
e in django, but i really appreciate this useful framework. I >> have a simple question but i don't know if is appropriate. >> >> i have a fixture written in JSON and i use it to provide initial data to >> my webapp. i want to provide in this fixture absolute paths in

Re: settings.py variables in fixtures

2015-12-27 Thread Russell Keith-Magee
> > i have a fixture written in JSON and i use it to provide initial data to > my webapp. i want to provide in this fixture absolute paths in order to > store some images. is there a way to use in JSON fixtures (or in > another format) variables defined in settings.py (eg.

settings.py variables in fixtures

2015-12-27 Thread Salvatore Scaramuzzino
n order to store some images. is there a way to use in JSON fixtures (or in another format) variables defined in settings.py (eg. base path of the app)? thanks in advance -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe

Re: Loading fixtures in Django 1.7

2014-11-11 Thread André Manzano
; - Leonard > > On Sunday, November 9, 2014 5:46:30 PM UTC-5, Leonard Wayne wrote: >> >> I am in the process of upgrading from >> Django 1.6 to 1.7. >> >> I have three fixtures. I am trying to figure >> out how I should load them. >> >> One fixture

Re: Loading fixtures in Django 1.7

2014-11-11 Thread Leonard Wayne
Fred, Got it!! Thank you!! - Leonard On Sunday, November 9, 2014 5:46:30 PM UTC-5, Leonard Wayne wrote: > > I am in the process of upgrading from > Django 1.6 to 1.7. > > I have three fixtures. I am trying to figure > out how I should load them. > > One fixture is `i

Re: Loading fixtures in Django 1.7

2014-11-09 Thread Fred Stluka
wrote: I am in the process of upgrading from Django 1.6 to 1.7. I have three fixtures. I am trying to figure out how I should load them. One fixture is `initial_data.json`, and I know that starting with Django 1.7 this special fixture no longer gets automatically loaded as it did when we used

Loading fixtures in Django 1.7

2014-11-09 Thread Leonard Wayne
I am in the process of upgrading from Django 1.6 to 1.7. I have three fixtures. I am trying to figure out how I should load them. One fixture is `initial_data.json`, and I know that starting with Django 1.7 this special fixture no longer gets automatically loaded as it did when we used to run

Re: I can't load fixtures

2014-08-17 Thread Davide Scatto
at version of django are you using? Davide Il giorno giovedì 14 agosto 2014 19:05:30 UTC+2, Daniel Grace ha scritto: > > I created a fixtures file called testdata.xml in a fixtures folder, but I > can't load the fixtures file into the database. > > I placed an __init__.py fi

Re: I can't load fixtures

2014-08-14 Thread eprikazc
'/myapps/fixtures' is treated as absolute path. Try removing leading slash to make it relative. Either you can write full absolute path to the directory. thanks, Eugene On Thursday, August 14, 2014 9:05:30 PM UTC+4, Daniel Grace wrote: > > I created a fixtures file called t

I can't load fixtures

2014-08-14 Thread Daniel Grace
I created a fixtures file called testdata.xml in a fixtures folder, but I can't load the fixtures file into the database. I placed an __init__.py file in the fixtures folder (not sure about this step, is it needed?) I put the fixtures directory in settings.py: FIXTURE_DIRS = ( &#

Initial fixtures with the auth Module

2013-10-17 Thread Dennis Hellmich
e for obj in objects: File "/usr/local/lib/python2.7/dist-packages/django/core/serializers/pyyaml.py", line 67, in Deserializer raise DeserializationError(e) DeserializationError: Problem installing fixture '/home/projects/fixtures/initial_data.yaml': Permi

Re: Tests not loading initial_data fixtures

2013-10-03 Thread Sam Lai
Ah, turns out all you have to do is specify - fixtures = [ 'initial_data' ] ... in the TestCase and it'll load all the initial_data fixtures from all apps. Still a bit odd that loading initial_data fixtures isn't the default in tests though. On 3 October 2013 16:49, S

Tests not loading initial_data fixtures

2013-10-02 Thread Sam Lai
I'm trying to test a Django management command in app X that parses data files and inserts data into models that are located in apps Y and Z. Apps Y and Z have initial_data.json files in them. On running my test however, it seems that my initial_data fixtures are not being loaded. I could sp

Re: Overriding Settings before running any tests that loads fixtures.

2013-09-22 Thread Alex Thomas
s that I am trying to run a test that loads fixtures but > I want to modify some settings before the fixtures are loaded. > > I tried adding override_settings decorator on the class but it does not > see to take effect before the fixtures are loaded. > I also posted the question

Re: Overriding Settings before running any tests that loads fixtures.

2013-09-21 Thread Mike Dewhirst
On 22/09/2013 9:47am, Alex Thomas wrote: My basic problem is that I am trying to run a test that loads fixtures but I want to modify some settings before the fixtures are loaded. Check out Two Scoops of Django - there is a whole chapter on this. Esssntially you need some test settings which

Overriding Settings before running any tests that loads fixtures.

2013-09-21 Thread Alex Thomas
My basic problem is that I am trying to run a test that loads fixtures but I want to modify some settings before the fixtures are loaded. I tried adding override_settings decorator on the class but it does not see to take effect before the fixtures are loaded. I also posted the question

Passing multiple related fixtures to django management loaddata

2013-07-02 Thread Bayard Randel
Hi there, I have a south migration where I'm using django.core.management.call_command() to load yaml fixtures for 2 models into Postgres. Currently I have multiple fixtures with circular foreign key relationships and concatenate these to a single fixture. Ideally, for ease of maintenan

Fixtures and non-ascii data error reporting bug

2013-04-18 Thread Колпаков Евгений
Hi everybody. I have a UTF-8 encoded fixture (initial_data.yaml, but I think it's irrelevant) that contains some data to create auth.Group models. The names of models are non-ascii characters. Syncdb and loaddata works smoothly, so it's *not* a question "my non-ascii data is not loading". The

Django/Selenium how to prevent fixtures from being created more than once (during LiveServerTestCase run)?

2012-11-26 Thread Federico Mendez
Problem: I'm using factory_boy to create some mock up objects so I don't have to use fixtures in my tests (this isn't causing the problem though). I have a function called _create_fixtures() that is called in the setUp() of my class which is causing the following Integri

Re: skip fixtures loading on 'manage.py test myapp'

2012-08-22 Thread Anton Baklanov
exactly On Wed, Aug 22, 2012 at 2:24 AM, Karen Tracey wrote: > That link doesn't really explain why south would be loading fixtures that > Django itself wouldn't ordinarily load. Unless...do you have migrations > that are loading fixtures? > -- Regards, Anton Baklanov

Re: skip fixtures loading on 'manage.py test myapp'

2012-08-21 Thread Karen Tracey
On Mon, Aug 20, 2012 at 12:40 PM, Anton Baklanov wrote: > and, if anyone is interested, here is the answer - > http://south.readthedocs.org/en/latest/settings.html#south-tests-migrate > > That link doesn't really explain why south would be loading fixtures that Django itself wo

Re: skip fixtures loading on 'manage.py test myapp'

2012-08-20 Thread Anton Baklanov
ng like that. > Problem is in South - when i remove it from INSTALLED_APPS 'manage.py test > myapp' does not load any fixtures except 'initial_data'. > > So, i'm going to south sources now. > > Thanks! > > > On Mon, Aug 20, 2012 at 12:01 PM, Mel

Re: skip fixtures loading on 'manage.py test myapp'

2012-08-20 Thread Anton Baklanov
Hi Melvyn! Just tested it on dummy project, and you are right - django itself does not do anything like that. Problem is in South - when i remove it from INSTALLED_APPS 'manage.py test myapp' does not load any fixtures except 'initial_data'. So, i'm going to south sour

Re: skip fixtures loading on 'manage.py test myapp'

2012-08-20 Thread Melvyn Sopacua
On 19-8-2012 19:05, Anton Baklanov wrote: > When I'm running 'manage.py test myapp' it loads all fixtures that are in > 'myapp/fixtures' directory. Are you sure about that? I think it only loads what is loaded also with syncdb, so initial_data.*. > And wh

skip fixtures loading on 'manage.py test myapp'

2012-08-19 Thread Anton Baklanov
Hi! When I'm running 'manage.py test myapp' it loads all fixtures that are in 'myapp/fixtures' directory. And what I want is to find a way to tell django skip this fixtures and instead load some other ones or maybe no fixtures at all for certain tests. Is it possible? --

Fixtures for default user (admin)

2012-04-08 Thread abisson
Hi, So I have the following directories: myproject myproject accounts fixtures initial_data.yaml Now, inside accounts, I have a class called UserProfile. In the fixtures directory, I added initial_data.yaml, but it is not working. Basically, I want to create a

Re: Script to call loaddata on multiple fixtures

2012-02-20 Thread Tom Evans
On Sat, Feb 18, 2012 at 4:46 PM, LJ wrote: > I have quite a number of fixtures that I call loaddata to insert > fixtures into my sqlite database using the following syntax: > > python ./manage.py loaddata ./apps/addresses/fixtures/cities.json > python ./manage.py loaddata .

Re: Testing: Fixtures vs Factories vs ???

2012-02-19 Thread Steve Bywater
I work on a complex django project -- our test suite is over 1000 tests. We've begun converting them from fixtures to factories. Here's why: - Factories were measurably faster. At least in my local environment, which may be more IO bound than others, but I was looking at the results of

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
Thanks, Dennis. Some of the fixtures are order dependent. I will have to do some more research on how to use glob.glob() and spawn. For now, just adding the list of python loaddata commands to a shell script seem to work great. Thanks again for the info! L J On Feb 18, 4:33 pm, Dennis Lee Bieber

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
That worked great. I haven't done much shell scripting, but it was easier than I thought. Thanks, Shawn! L J On Feb 18, 9:46 am, LJ wrote: > I have quite a number of fixtures that I call loaddata to insert > fixtures into my sqlite database using the following syntax: > > p

Re: Testing: Fixtures vs Factories vs ???

2012-02-18 Thread Alvaro
g away on my latest Django project, and have recently > started to think about how best to test the functionality I have so far. > > Creating fixtures for my tests seems like a good idea initially, but from > experience I find fixtures become harder and harder to maintain as the >

Re: Script to call loaddata on multiple fixtures

2012-02-18 Thread Shawn Milochik
Why not just put all those manage.py commands in a shell script and run that? -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to dja

Script to call loaddata on multiple fixtures

2012-02-18 Thread LJ
I have quite a number of fixtures that I call loaddata to insert fixtures into my sqlite database using the following syntax: python ./manage.py loaddata ./apps/addresses/fixtures/cities.json python ./manage.py loaddata ./apps/addresses/fixtures/addresses.json ... I would like to create a script

Re: Testing: Fixtures vs Factories vs ???

2012-02-17 Thread Shawn Milochik
ly do it the simplest way possible. If you're trying to add coverage after the code is in place, there's often a large amount of "setup" needed due to model relationships, and it's easier to just dump everything into fixtures and write tests to your known data. There's a

Testing: Fixtures vs Factories vs ???

2012-02-17 Thread Paolo
Hi folks, I've been coding away on my latest Django project, and have recently started to think about how best to test the functionality I have so far. Creating fixtures for my tests seems like a good idea initially, but from experience I find fixtures become harder and harder to mainta

Re: Error making fixtures

2012-02-01 Thread akaariai
On Feb 1, 12:26 pm, xina towner wrote: > Hello, I'm tryng to do fixtures with dumpdata. I write this command: > > python manage.py dumpdata quests --indent=4 > > quests/fixtures/quests_views_testdata.json > > But I get this error message: > > _mysql_exceptions.O

Error making fixtures

2012-02-01 Thread xina towner
Hello, I'm tryng to do fixtures with dumpdata. I write this command: python manage.py dumpdata quests --indent=4 > quests/fixtures/quests_views_testdata.json But I get this error message: _mysql_exceptions.OperationalError: (1054, "Unknown column 'quests_quest.availabili

Fixtures and FileField

2011-10-25 Thread Tomek Paczkowski
Hello, I'm looking for some way of bundling files from FileFields into fixtures. There is clear void of information on this subject. -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the w

Porting BugFix #3615 (Can't define forward references in fixtures using MySQL with InnoDB) to Django 1.3.1

2011-10-06 Thread Kirill Panshin
Hey, If you get this problem with your fixtures when loading them into MySQL InnoDB, you can use this forked branch of Django: https://github.com/kipanshi/django/tree/1.3.1.1 To install via pip: pip install -e git+git://github.com/kipanshi/ django.git@1.3.1.1#egg=django-1.3.1.1

Re: South migration for fixtures

2011-05-26 Thread Amit Sethi
And what process should be followed in production and for other collaborators. -- A-M-I-T S|S -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group,

Re: South migration for fixtures

2011-05-25 Thread DrBloodmoney
On Wed, May 25, 2011 at 12:54 PM, Amit Sethi wrote: > Hi all , I might be wrong with some of the concepts as I am new to > south. I am using south to migrate some fixture data for a django app. > Also something worth noting is I am bringing south new into the django > app it was not part of instal

South migration for fixtures

2011-05-25 Thread Amit Sethi
error related to fixtures not getting installed . Because I haven't actually changed the data on my fixtures how can I do that(Also when should I do that) . My confusion also is that if I dump data now to create new fixtures I will be creating trouble for my collaborators since when they run sync

Re: fixtures with updated timestamps

2011-03-30 Thread Marcos Moyano
You can write a pre_save signal http://docs.djangoproject.com/en/dev/ref/signals/#django.db.models.signals.pre_save Hope it helps, Marcos On Wed, Mar 30, 2011 at 8:09 AM, Robert Šmol wrote: > Hi, > > is it possible to load fixtures of models that have a datetime field and > then u

fixtures with updated timestamps

2011-03-30 Thread Robert Šmol
Hi, is it possible to load fixtures of models that have a datetime field and then updated those? I mean we have a nice preset database, but it gets old over time, I need to refresh the time attributes during tests and new development deployments. Robert -- You received this message because

Re: Generic Foreign Keys in fixtures

2011-03-24 Thread Shawn Milochik
On Thu, Mar 24, 2011 at 3:29 PM, Simone Dalla wrote: >> Natural keys were introduced in 1.2. How would you do this in 1.1? > > 1.2 > -- You mean 1.3, right? ;o) -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email

Re: Generic Foreign Keys in fixtures

2011-03-24 Thread Simone Dalla
2011/3/24 Shawn Milochik > On Thu, Mar 24, 2011 at 2:29 PM, Simone Dalla wrote: > > > > maybe option --natural > > > http://docs.djangoproject.com/en/1.3/ref/django-admin/#dumpdata-appname-appname-appname-model > > > > > Natural keys were introduced in 1.2. How would you do this in 1.1? > 1.2

Re: Generic Foreign Keys in fixtures

2011-03-24 Thread Shawn Milochik
r answer when the problem is re-stated: How can you use dumpdata and loaddata to dump and reload fixtures when you're using generic foreign keys? (I work with the OP, so I'm not hijacking the thread). Thanks, Shawn -- You received this message because you are subscribed to the Google Group

Re: Generic Foreign Keys in fixtures

2011-03-24 Thread Simone Dalla
t; > My current thinking is to make an explicit fixture the dumpdata from > contenttypes at the same time I generate the other fixtures I plan to > use in my tests. From there, I will add code to manually update the > content types in the database to the ones in the aforementioned > content

Generic Foreign Keys in fixtures

2011-03-24 Thread LurkingFrog
the dumpdata from contenttypes at the same time I generate the other fixtures I plan to use in my tests. From there, I will add code to manually update the content types in the database to the ones in the aforementioned contenttypes fixture and call it from the __init__.py in each application/tests

Re: How do I run test and get results programmatically? (django, south, fixtures, sqlite)

2011-03-14 Thread Jumpfroggy
@gladys, While that didn't solve my original question, it did solve another related problem. Before, I had issue with migrations failing since they depended on pre-existing data (which did not exist in the blank testing database). But if I added an initial_data.json fixture, it gets run for ever

Re: No fixtures found

2011-03-14 Thread Shakthi Kannan
Hi, --- On Fri, Mar 11, 2011 at 6:25 PM, Kenneth Gonsalves wrote: | I tried this out after you brought it up in IRC and made the smallest | possible test. It works for me regardless of what name I give the | fixtures file as long as it is in the fixtures directory of the | application. You must

Re: How do I run test and get results programmatically? (django, south, fixtures, sqlite)

2011-03-13 Thread gladys
ase, and > uses it for all tests.  However, when I run my own tests, it uses the > mysql backend.  If I force it to use sqlite, is has problems with the > fixtures because the migrations are not run before installing the > fixtures. > > How do I run tests manually using the sam

How do I run test and get results programmatically? (django, south, fixtures, sqlite)

2011-03-11 Thread Jumpfroggy
, but the problem is the database. When I run the "python manage.py test" command, it automatically uses sqlite3 as the backend, creates the database, and uses it for all tests. However, when I run my own tests, it uses the mysql backend. If I force it to use sqlite, is has problems

Re: No fixtures found

2011-03-11 Thread Kenneth Gonsalves
On Fri, 2011-03-11 at 16:48 +0530, Shakthi Kannan wrote: > No fixtures found. I tried this out after you brought it up in IRC and made the smallest possible test. It works for me regardless of what name I give the fixtures file as long as it is in the fixtures directory of the application.

No fixtures found

2011-03-11 Thread Shakthi Kannan
django.test import TestCase from polls.models import Poll class SimpleTestCase(TestCase): fixtures = ['poll.json',] === mysite/polls/models.py === from django.db import models class Poll(models.Model): question = models.CharField(max_length=200) pub_date = models.DateTimeField('

Re: testing: running something after the fixtures have been loaded

2011-02-10 Thread Karen Tracey
On Tue, Feb 8, 2011 at 4:05 PM, Bram de Jong wrote: > as far as I read it the django unit tests run setUp before the > fixtures are loaded... > is that correct? > No, where did you read that? Karen -- http://tracey.org/kmt/ -- You received this message because you are subsc

testing: running something after the fixtures have been loaded

2011-02-08 Thread Bram de Jong
Hi, we want to write some testing code, but our site uses Solr for indexing. The test cases we are running are testing -among other things- the searching. problem is: we need to run some additional code to index the stuf the fixtures just inserted into the DB. as far as I read it the django

Re: Handling huge fixtures

2011-01-15 Thread Steve Bywater
I use this exact dataset. Instead of using a fixture called initial_data.json for that whole dataset, call it something else like zip_code.json. You can use loaddata to load it whenever you are setting up a new environment. For your tests, have a minimal subset of zips in initial_data, or in anothe

Handling huge fixtures

2011-01-14 Thread mack the finger
We have a feature of our django application where the user will enter a zipcode, and out site will lookup that zipcode against a database table and return the city and state. In order for us to do this, we have a ZipCode model, and a 22 thousand line initial_data.json fixture. The problem is th

  1   2   3   4   5   >