Re: How to mock models while testing views?

2011-01-25 Thread Ryan McKillen
Guys, thanks for the insights. On Tue, Jan 25, 2011 at 2:11 PM, Daniel Holth wrote: > Typically my models are not very smart, so I am not usually worried about > model-bugs interfering with other tests and I just insert real ones into a > sqlite:///:memory: database. However, > > def view_under

Re: Using SQLAlchemy with Traversal.

2011-01-25 Thread Daniel Holth
Kyle, You should be able to do something as simple as class Foo: bars = relationship(Bar, backref='__parent__') Is it necessary? With the default traversal implementation you override __getitem__ to return objects with __name__ and __parent__: def __getitem__(self, key): b

Re: Using SQLAlchemy with Traversal.

2011-01-25 Thread Rob Miller
On 1/25/11 3:54 PM, Kyle Terry wrote: I know this isn't the SQLAlchemy list, but I've been designing my resource tree using SQLAlchemy and traversal for my up coming project. I was thinking about starting a discussion and possibly getting some help on a problem I'm having. I have the Foo resourc

Using SQLAlchemy with Traversal.

2011-01-25 Thread Kyle Terry
I know this isn't the SQLAlchemy list, but I've been designing my resource tree using SQLAlchemy and traversal for my up coming project. I was thinking about starting a discussion and possibly getting some help on a problem I'm having. I have the Foo resource, which is an object mapped to the foo

Re: How to mock models while testing views?

2011-01-25 Thread Daniel Holth
Typically my models are not very smart, so I am not usually worried about model-bugs interfering with other tests and I just insert real ones into a sqlite:///:memory: database. However, def view_under_test(request): return dict(user_id=request.db.query(User).get(authenticated_userid(reques

Re: How to mock models while testing views?

2011-01-25 Thread Ryan McKillen
Tres, thanks. Would be a big help if you could show me a more complete example. On Tue, Jan 25, 2011 at 11:17 AM, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 01/25/2011 01:38 PM, Ryan wrote: > > I use PyMox for mocking in unit testing of models. While testing vie

Re: How to mock models while testing views?

2011-01-25 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 01/25/2011 01:38 PM, Ryan wrote: > I use PyMox for mocking in unit testing of models. While testing views, I'd > like to mock model methods as well. Any examples of how to do this? > > Or, is this the wrong approach? Should the view tests be consi

Re: Pyramid 1.0b2 released

2011-01-25 Thread Alex Clark
On 1/25/11 2:51 PM, Kyle Terry wrote: I love it! Kudos and thanks, indeed! Looking forward to 1.0. On Jan 25, 2011 9:15 AM, "Seth" mailto:seedifferen...@gmail.com>> wrote: > Chris, > > This is such exciting news! Thanks for all your hard work (and everyone else > who has contributed). >

Re: Pyramid 1.0b2 released

2011-01-25 Thread Kyle Terry
I love it! On Jan 25, 2011 9:15 AM, "Seth" wrote: > Chris, > > This is such exciting news! Thanks for all your hard work (and everyone else > who has contributed). > > Seth > > -- > You received this message because you are subscribed to the Google Groups "pylons-devel" group. > To post to this gr

Re: How to mock models while testing views?

2011-01-25 Thread Ryan McKillen
Mike, thanks. Makes sense. Out of curiosity, if I wanted to mock the models in a test of views, how would I do that? On Tue, Jan 25, 2011 at 11:33 AM, Mike Orr wrote: > On Tue, Jan 25, 2011 at 10:38 AM, Ryan wrote: > > I use PyMox for mocking in unit testing of models. While testing views, >

Re: How to mock models while testing views?

2011-01-25 Thread Mike Orr
On Tue, Jan 25, 2011 at 10:38 AM, Ryan wrote: > I use PyMox for mocking in unit testing of models. While testing views, I'd > like to mock model methods as well. Any examples of how to do this? > Or, is this the wrong approach? Should the view tests be considered full > integration tests, and ther

How to mock models while testing views?

2011-01-25 Thread Ryan
I use PyMox for mocking in unit testing of models. While testing views, I'd like to mock model methods as well. Any examples of how to do this? Or, is this the wrong approach? Should the view tests be considered full integration tests, and therefore not be mocked? -- You received this message

Re: Pyramid 1.0b2 released

2011-01-25 Thread Seth
Chris, This is such exciting news! Thanks for all your hard work (and everyone else who has contributed). Seth -- You received this message because you are subscribed to the Google Groups "pylons-devel" group. To post to this group, send email to pylons-devel@googlegroups.com. To unsubscribe

Re: Help: Error while rendering chameleon zpt template

2011-01-25 Thread Wichert Akkerman
FWIW: we have many genshi templates with Chinese text encoded in UTF-8, and they work fine with Chameleon. Wichert. On 1/25/11 12:00 , Savio Sabino wrote: with char codes© and© work fine. On 25 jan, 08:45, Savio Sabino wrote: Maybe this a problem of encode in windows or an application in w

Re: Help: Error while rendering chameleon zpt template

2011-01-25 Thread Savio Sabino
with char codes © and © work fine. On 25 jan, 08:45, Savio Sabino wrote: > Maybe this a problem of encode in windows or an application in > windows. > > On 25 jan, 08:44, Savio Sabino wrote: > > > I copy and paste the views of the tutorial web page in pylonsproject. > > And I have test the frame

Re: Help: Error while rendering chameleon zpt template

2011-01-25 Thread Savio Sabino
Maybe this a problem of encode in windows or an application in windows. On 25 jan, 08:44, Savio Sabino wrote: > I copy and paste the views of the tutorial web page in pylonsproject. > And I have test the framework in windows xp using: > notepad++. > google chrome. > cmd. > python 2.5. > > for ins

Re: Help: Error while rendering chameleon zpt template

2011-01-25 Thread Savio Sabino
I copy and paste the views of the tutorial web page in pylonsproject. And I have test the framework in windows xp using: notepad++. google chrome. cmd. python 2.5. for install I follow the tutorial (use of: easy_install,virtualenv,paste). On 24 jan, 16:48, Chris McDonough wrote: > I'd love to k