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:
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
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
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)
>
>
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
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
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
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
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
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
10 matches
Mail list logo