RESTful web service unit tests

2011-05-12 Thread Bruno Ripa
Hi all,


  i am writing some tests to test a RESTful api i have written
(Django 1.3, using piston, python 2.6.5).

The url is basically: /api/products and you need to be logged to
access it.

We can use such api, via curl PUT query (the client code uses pycurl
to access the ws).

It works in production / development, but not the tests.

So far i've tried:

1. send credentials to the web service when doing the PUT request
2. successfully login, and consequentely contact the ws

in both cases, the response is an Authorization Required and status
code is 401.

Btw, i am using follow = True (and so i have a redirect chain with a
301 status).

I am pretty sure i am doing something wrong, but can't spot it.

Any help ?

Thanks in advance,
  B.
N.b.: here is the code i'm using to test:


class CommunicationTests(TestCase):
   """
   """

   def setUp(self):
   """
   """

   admin = User.objects.create_user('admin',
'admin@some','admin')
   admin.is_staff = True
   admin.save()


   self._client = client.Client()

   self._connected = self._client.login(username="admin",
password="admin")

   def test_contactWS(self):
   """
   """

   self.assertTrue(self._connected)

   credentials = {
   "username":"admin",
   "password":"admin"
   }

   response = self._client.put(path="/api/products",follow=True,
**credentials)

Ofc, i am changing very often this code to make tests, not all the
scenarios are reported here.

P.s.: sorry to the people reading again this mail, sent before to the
wrong list.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Best django ecommerce aplication?

2011-05-19 Thread Bruno Ripa
Hi,

   we used satchmo for several ecommerce applications, integrating several
technologies:

- satchmo for ecommerce
- Plone for content management
- xdv (now diazo) for the presentation layer

It is of course a good product, but it needs some tuning and at least a
little/medium rethinking of the admin interface: customers look for
something "smart enough" to help them managing the shop, not a simple list
of the features of the shop (admin interface is implemented as a simple
enumeration of its features).

Anyway, we are evaluating http://www.getlfs.com/ (Lighting Fast Shop),
another implementation of ecommerce shop, based on django.

It "ships" with a better idea of interfaces, even if based on older contepts
- like floating menus - but maybe it is what a casual web surfer with
commerce needs looks for.

Hope this helps.

Bruno Ripa

2011/5/19 Bruno Ripa 

> Hi,
>
>we used satchmo for several ecommerce applications, integrating several
> technologies:
>
> - satchmo for ecommerce
> - Plone for content management
> - xdv (now diazo) for the presentation layer
>
> It is of course a good product, but it needs some tuning and at least a
> little/medium rethinking of the admin interface: customers look for
> something "smart enough" to help them managing the shop, not a simple list
> of the features of the shop (admin interface is implemented as a simple
> enumeration of its features).
>
> Anyway, we are evaluating http://www.getlfs.com/ (Lighting Fast Shop),
> another implementation of ecommerce shop, based on django.
>
> It "ships" with a better idea of interfaces, even if based on older
> contepts - like floating menus - but maybe it is what a casual web surfer
> with commerce needs looks for.
>
> Hope this helps.
>
> Bruno Ripa
>
> 2011/5/19 podio 
>
>> I was thinking to migrate my page to python, I choose Django and know
>> need a shop aplication I was thinking in http://satchmoproject.com/.
>>
>> There some other else better?
>>
>> Thanks!
>>
>> Sorry my english  Im a bit rusty
>>
>> --
>> 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
>> django-users+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/django-users?hl=en.
>>
>>   Contatti Seguimi su  [image: mail] Bruno Ripa - CTO [
> bruno.r...@abstract.it]
> [image: www] Abstract Open Solutions [http://www.abstract.it]
> [image: telephon fax] Mobile: +39 392-9784024 - Fax +39 081-0112239
> [image: no word attachments]
> http://www.gnu.org/philosophy/no-word-attachments.it.html  [image:
> Facebook] <http://www.facebook.com/bruno.ripa> [image: Twitter]
> <http://twitter.com/brunoripa> [image: LinkedIn]
> <http://www.linkedin.com/in/brunoripa>  Ai sensi del d.lgs. 196 del 30
> giugno 2003, recante disposizioni per la tutela delle persone e di altri
> soggetti rispetto al trattamento dei dati personali, si precisa che questa
> email è inviata unicamente ai destinatari sopra esposti, con espressa
> diffida di leggerla, copiarla, diffonderla ed usarla senza autorizzazione.
> Se avete ricevuto questa email per errore, vi preghiamo di distruggerla
> immediatamente e contattarci tramite uno dei recapiti sopra indicati.
>
>   Contatti Seguimi su  [image: mail] Bruno Ripa - CTO [
bruno.r...@abstract.it]
[image: www] Abstract Open Solutions [http://www.abstract.it]
[image: telephon fax] Mobile: +39 392-9784024 - Fax +39 081-0112239
[image: no word attachments]
http://www.gnu.org/philosophy/no-word-attachments.it.html  [image: Facebook]
<http://www.facebook.com/bruno.ripa> [image: Twitter]
<http://twitter.com/brunoripa> [image: LinkedIn]
<http://www.linkedin.com/in/brunoripa>  Ai sensi del d.lgs. 196 del 30
giugno 2003, recante disposizioni per la tutela delle persone e di altri
soggetti rispetto al trattamento dei dati personali, si precisa che questa
email è inviata unicamente ai destinatari sopra esposti, con espressa
diffida di leggerla, copiarla, diffonderla ed usarla senza autorizzazione.
Se avete ricevuto questa email per errore, vi preghiamo di distruggerla
immediatamente e contattarci tramite uno dei recapiti sopra indicati.

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



Re: Best django ecommerce aplication?

2011-05-19 Thread Bruno Ripa
Hi,

   i meant that such interfaces is closer to "windows-app-style" than to web
structures, simply as that.

Anyway, customers recognize that, and appreciate.

+1 for lfs for that.

2011/5/20 Kai Diefenbach 

> Servus,
>
>
> On 2011-05-19 10:47:24 +0200, Bruno Ripa said:
>
>  Anyway, we are evaluating http://www.getlfs.com/ (Lighting Fast Shop),
>> another implementation of ecommerce shop, based on django.
>>
>> even if based on older contepts - like floating menus
>>
>
> What does this mean? What is more up-to-date?
>
> Kai
>
>
> --
> 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
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
>

-- 
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 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.