Testing class based views

2012-03-15 Thread msbuck
I have used class based views in my latest project. Now I'm trying to write tests. I can write tests like the ones I wrote for function based views but these seem to me to be functional tests. Does anyone do unit testing on a class based view methods? I'm not sure how to go about instantiating a

Re: Django Snippet imports?

2012-02-03 Thread msbuck
Yes you need to put register = template.Library() in your module. See https://docs.djangoproject.com/en/1.3/howto/custom-template-tags/ for more info on where this code should reside. On Feb 3, 9:17 am, Jesramz wrote: > source:http://djangosnippets.org/snippets/847/ > > from django.contrib.auth.m

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
ie)? On Oct 19, 2:45 pm, dmitry b wrote: > I'm starting to doubt this is a Django issue.  Double check that you > are connecting to the database/schema you *think* you are connecting > to and you are using the use account you *think* you are using :) > > D. > > On Oct 19, 11:4

Re: direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
ry works: > >  cursor.execute('SELECT account_number FROM vw_billed_summary_fact > WHERE ippa=%s', ['col11-emnj00-1147']) > > d. > > On Oct 19, 8:25 am, msbuck wrote: > > > > > > > > > I'm having another strange problem. I'm

direct query to Oracle db view doesn't work

2011-10-19 Thread msbuck
I'm having another strange problem. I'm executing SQL statements directly rather than using the ORM and it is working fine except when I query one particular view. Then the query returns nothing. I can execute the same query from python by using the cx_Oracle module directly and it returns what I e

Re: how to access a foreignKey with multiple constraints

2011-10-06 Thread msbuck
ent reports and form. Thanks! On Oct 6, 1:55 pm, msbuck wrote: > I have a legacy Oracle database which I'm trying to model. I used > inspectdb which did a good job. However, a few of my tables contain > two fields which combine to form a foreign key constraint. In other > words

how to access a foreignKey with multiple constraints

2011-10-06 Thread msbuck
I have a legacy Oracle database which I'm trying to model. I used inspectdb which did a good job. However, a few of my tables contain two fields which combine to form a foreign key constraint. In other words the legacy database was created like this: CREATE TABLE "MY_TABLE" ("TRACKING_ID" NUMBER N

Re: Randomly clearing database tables

2011-10-06 Thread msbuck
On Oct 5, 12:09 pm, Ian Kelly wrote: > On Tue, Oct 4, 2011 at 2:28 PM, msbuck wrote: > > Below is the settings. I am fairly new to python unit testing so my > > understanding of things could be better. But right now, if I select > > Run As -> Python Unit Test will my pro

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
27;mysql', 'sqlite3' or 'oracle'. 'NAME': 'db_name', # Or path to database file if using sqlite3. 'USER': 'spin_log_user', # Not used with sqlite3. 'PASSWORD':

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
t's what clears out my tables. Now I just have to figure out how to disable the option in Eclipse or get it to do nothing. Any suggestions in this area would be appreciated and thanks to all for the suggestions. On Oct 4, 11:08 am, msbuck wrote: > I don't have an initial_data.* fixtures

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
On Oct 4, 10:49 am, John Handelaar wrote: > On 4 October 2011 15:11, msbuck wrote: > > > Twice now, I have had most of my django tables cleared from my > > database including my app tables. Obviously I need to track this down. > > In addition to the two table

Re: Randomly clearing database tables

2011-10-04 Thread msbuck
g your database? > Have you made some special test configuration? > > -- > eng. Ilian Iliev > Web Software Developer > > Mobile: +359 88 66 08 400 > Website:http://ilian.i-n-i.org > > > > > > > > On Tue, Oct 4, 2011 at 5:11 PM, msbuck wrote: > > Tw

Randomly clearing database tables

2011-10-04 Thread msbuck
Twice now, I have had most of my django tables cleared from my database including my app tables. Obviously I need to track this down. In addition to the two tables created by my app, the AUTH_USER, AUTH_USER_USER_PERMISSIONS and DJANGO_ADMIN_LOG are cleared. The AUTH_PERMISSION, DJANGO_CONTENT_TYPE