Accessing Django test client in setUpClass

2015-01-22 Thread Nicole Harris
I just posted this on Stack Overflow and then realised I might have more 
luck here.

Basically, I'd like to know if I can access self.client inside 
setUpClass(cls) when setting up a Django test:
http://stackoverflow.com/questions/28084683/accessing-django-test-client-in-setupclass

If anybody has any insight on this, I'd really appreciate it :)

-- 
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/fb4e3cd7-a70a-4a7c-b61f-f6ef73d7e226%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Validation on two user foreign keys

2015-01-28 Thread Nicole Harris
Hi All,

I have a model called 'Friendship' that includes two foreign keys to User.  
One is the 'initiator' of the Friendship, the other the 'recipient'. 
I want to make sure the Friendship only exists once regardless of who is 
the recipient and who is the initiator.
Any thoughts on the best way to validate for this?
Should I create a custom manager and override .objects.create() ?

Thanks for your time :)
Nicole

-- 
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/cd0ad08f-f0fa-4884-94a8-3700577369bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Registering a stand-alone test app

2015-02-10 Thread Nicole Harris
Hi All,

I have an app in my root folder named 'bdd'.  It contains an (empty) 
models.py as well as some files for running behave 
 tests.
I have added this app to INSTALLED_APPS in my settings.py so that I can run 
the tests with the Django Behave 
 test runner.

When I deploy my application to Heroku, I get the following error: 
*The app module  has multiple filesystem 
locations (['./bdd', './bdd', '/app/bdd']); you must configure this app 
with an AppConfig subclass with a 'path' class attribute.*

Interestingly, this does not happen locally, or on my CI server.  

I am running 1.7, so my best guess is that this has something to do with 
https://docs.djangoproject.com/en/1.7/releases/1.7/#app-registry-consistency, 
but I'm having some trouble working out what the problem is.

I do *not* have another app or folder called "app" so, I can't make any 
sense of the '/app/bdd' line in the error message.

What's going on here?  Is it possible that my 'bdd' app is conflicting with 
another package?

Thanks in advance :D
Nicole


-- 
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/6db47a08-fdb3-4f8b-87ee-de3a409fdee9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.