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
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
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"
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
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:
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
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
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
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
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
&
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
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
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
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
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
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.
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
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
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
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
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.
--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
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
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
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
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')
>
>
> 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
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
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
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
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
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
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
@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
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
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
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
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
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(
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.
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.
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
>
> 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.
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
; - 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
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
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
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
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
'/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 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 = (
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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?
--
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
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 .
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
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
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
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
>
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
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
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
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
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
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
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
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
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,
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
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
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
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
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
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
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
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
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
@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
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
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
, 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
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.
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('
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
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
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
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 - 100 of 453 matches
Mail list logo