stanislas: For creator, you'll probably want to make an EditorType, an Editor, a Creator, an EntityRevision and a CreatorData
2015-12-17 35141, 2015
LordSputnik
That's for GET
2015-12-17 35144, 2015
stanislas
Ok, the question was really about if I should use real data ?
2015-12-17 35153, 2015
LordSputnik
For POST, you'll only need EditorType and Editor
2015-12-17 35159, 2015
stanislas
because it may change in a matter of time
2015-12-17 35109, 2015
Leftmost
No, we have testing data specifically for the unit tests.
2015-12-17 35133, 2015
stanislas
And how can I access this data?
2015-12-17 35135, 2015
LordSputnik
stanislas: no, you'll need to instantiate instances of those classes (either in setUp or in the test itself), then save them to your local testing database
2015-12-17 35159, 2015
Leftmost
LordSputnik, doesn't the bootstrap stuff set up testing data already?
2015-12-17 35105, 2015
LordSputnik
The data is created as part of the test
2015-12-17 35109, 2015
LordSputnik
Leftmost: some of it
2015-12-17 35139, 2015
LordSputnik
Hmm
2015-12-17 35150, 2015
LordSputnik
Actually, yeah, you're right, most of the data should get made by bootstrap :)
You likely need to edit line 2 of config/test.py to reflect a user in your database. I can walk you through setting one up if you need.
2015-12-17 35132, 2015
stanislas
I would be happy if you do that.
2015-12-17 35104, 2015
Leftmost
Do you know where to find your pg_hba.conf file? (If not, which distro are you running?)
2015-12-17 35157, 2015
stanislas
Leftmost: btw. Do i have to run some local bb server when testing?
2015-12-17 35105, 2015
stanislas
Leftmost: debian
2015-12-17 35111, 2015
stanislas
Leftmost: debian 8
2015-12-17 35150, 2015
The_Catman has quit
2015-12-17 35159, 2015
Leftmost
-ws will run anything it needs to for you. You just need to have postgresql running.
2015-12-17 35115, 2015
Leftmost
Hmm. Check /var/lib for a directory called either pgsql or postgres or something of that ilk.
2015-12-17 35101, 2015
stanislas
Ok, i see where it is
2015-12-17 35100, 2015
CallerNo6
legoktm, the wiki logos should be good-to-go whenever you are in mb-wiki mode and looking for something to do.
2015-12-17 35122, 2015
Leftmost
Okay. So add a line that says `host sameuser bookbrainz 127.0.0.1/32 md5' to pg_hba.conf before the first line beginning with `host'.
2015-12-17 35120, 2015
legoktm
CallerNo6: awesome, I'll do that today evening
2015-12-17 35150, 2015
Leftmost
Then open up the psql commandline and run `CREATE USER bookbrainz WITH PASSWORD 'bookbrainz';'
2015-12-17 35126, 2015
stanislas
It says something like "role stas doesn't exist " (stas = my user name)
2015-12-17 35127, 2015
Leftmost
Oh, right. You have to run it as the postgres user. Run `sudo -i -u postgres' before running psql.
2015-12-17 35113, 2015
chirlu`
CallerNo6: Was this a task with one instance only?
2015-12-17 35120, 2015
stanislas
Leftmost: ok, done
2015-12-17 35136, 2015
Leftmost
Alright. You'll need to restart postgresql for the auth changes in pg_hba.conf to take effect, but once you've done that, try changing line 2 of config/test.py to read 'postgresql://bookbrainz:bookbrainz@localhost/bookbrainz_test'.
2015-12-17 35131, 2015
opatel99
Leftmost: looks like I just missed all the fun. I already organized all this into a file the day after we had it. Perhaps I could PR it as the INSTALL.md??
2015-12-17 35155, 2015
Leftmost
Maybe add it to the README.md under Setup and Testing headings.
2015-12-17 35144, 2015
opatel99
Leftmost: Cool. I will clean it up and tag all the code