Re: Strange error during migration

2014-07-15 Thread Tianyi Wang
Hi, It says that datetime object is not JSON serializable. You should convert it to string before converting it to JSON. For example: current_date = datetime.datetime.now() # it will throw error if you do json.dumps(current_date) # You should do as below json_string = json.dumps(('{:%Y-%m-%d %H:

Re: Are these tests redundant?

2014-07-15 Thread Tianyi Wang
dundant. That is already tested in django itself. > > Regards, > Esau Rodriguez. > El 15/07/2014 16:48, "Tianyi Wang" > > escribió: > >> Hi, >> >> I have a very simple model: >> >> class Action(models.Model): >> name = mod

Are these tests redundant?

2014-07-15 Thread Tianyi Wang
Hi, I have a very simple model: class Action(models.Model): name = models.CharField('Name', max_length=100) deleted = models.BooleanField('Deleted', default=False) def __unicode__(self): return self.name class Meta: ordering = ('name',) My tests for this model i

Re: Interesting Django project folder structure.

2014-04-21 Thread Tianyi Wang
have worked with uses this > particular structure. > > sent form mobile, apologies for the brevity > On Apr 21, 2014 7:30 PM, "Tianyi Wang" > > wrote: > > Today I was reading through > http://www.deploydjango.com/django_project_structure (great resource) > >

Interesting Django project folder structure.

2014-04-21 Thread Tianyi Wang
Today I was reading through http://www.deploydjango.com/django_project_structure (great resource) The suggested folder structure for a Django project from this site is like below: (I'm only interested in layout for Django apps, not requirements files or settings files) myproject |-- manag

Re: Copy all the data from an existing database when create the testing database.

2013-10-07 Thread Tianyi Wang
Thanks Kelvin, I will have a look at this. It seems interesting. Kelvin Wong writes: > Consider using model factories (you can roll your own) or FactoryBoy > > https://factoryboy.readthedocs.org/en/latest/ > > K > > > On Friday, October 4, 2013 9:17:51 AM UTC-7, Tianyi Wan

Re: Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
d the fixtures in you tests as needed. > > Chaim > > On Friday, October 4, 2013 8:48:45 AM UTC-5, Tianyi Wang wrote: >> >> Hi, >> >> When I run my tests, I'd like it to copy an existing database with all >> the data when create the testing database. &g

Copy all the data from an existing database when create the testing database.

2013-10-04 Thread Tianyi Wang
Hi, When I run my tests, I'd like it to copy an existing database with all the data when create the testing database. I never thought about this till one of my colleague uses POSTGIS_TEMPLATE = DATABASES['default']['NAME'] for his tests. Because we use GeoDjango for our project, so POSTGIS_TEM

Re: How to use selenium test against different browsers using LiveServerTestCase

2013-09-27 Thread Tianyi Wang
Thanks for all your answers. On Thursday, 26 September 2013 17:46:43 UTC+1, Tianyi Wang wrote: > > Hi guys, > > So follow the Django doc example, > https://docs.djangoproject.com/en/dev/topics/testing/overview/#django.test.LiveServerTestCase > > In the example, the t

How to use selenium test against different browsers using LiveServerTestCase

2013-09-26 Thread Tianyi Wang
Hi guys, So follow the Django doc example, https://docs.djangoproject.com/en/dev/topics/testing/overview/#django.test.LiveServerTestCase In the example, the test only test against Firefox. How can I test against different browsers without duplicate the example code? Thanks Tianyi -- You rec