So same issue, Can some help me understand which method is not mocked
out
Traceback (most recent call last):
File "/home/vbabiy/projects/git-projects/howsthedotcom/accounts/
tests/send_email_verification.py", line 27, in test_find
self.assertEquals(com.handle(), date)
File "/home/vbabiy/projects/git-projects/howsthedotcom/accounts/
management/commands/send_email_verification.py", line 12, in handle
evs = EmailVerification.objects.filter
(last_sent_at__lte=check_date)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
manager.py", line 129, in filter
return self.get_query_set().filter(*args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 498, in filter
return self._filter_or_exclude(False, *args, **kwargs)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/
query.py", line 516, in _filter_or_exclude
clone.query.add_q(Q(*args, **kwargs))
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
query.py", line 1675, in add_q
can_reuse=used_aliases)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
query.py", line 1614, in add_filter
connector)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
where.py", line 56, in add
obj, params = obj.process(lookup_type, value)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/sql/
where.py", line 269, in process
params = self.field.get_db_prep_lookup(lookup_type, value)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/
__init__.py", line 507, in get_db_prep_lookup
return super(DateField, self).get_db_prep_lookup(lookup_type,
value)
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/
__init__.py", line 210, in get_db_prep_lookup
return [self.get_db_prep_value(value)]
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/
__init__.py", line 569, in get_db_prep_value
return connection.ops.value_to_db_datetime(self.to_python(value))
File "/usr/local/lib/python2.6/dist-packages/django/db/models/fields/
__init__.py", line 533, in to_python
if isinstance(value, datetime.datetime):
File "/var/lib/python-support/python2.6/mox.py", line 414, in
__getattr__
raise UnknownMethodCallError(name)
UnknownMethodCallError: Method called is not a member of the object:
__bases__
> > On Sun, Jun 14, 2009 at 11:04 PM, steve middlekauff <
smidd...@gmail.com>
> > wrote:
>
> >> Ha, I was _just_ re-looking through some of the other threads on this
> >> topic. I'll add it to the FAQ tomorrow.
>
> >> On Sun, Jun 14, 2009 at 8:01 PM, David Glasser<
glas...@davidglasser.net>
> >> wrote:
> >> > Steve, this is probably the most frequently asked question, maybe it
> >> > should
> >> > go in some FAQ!
>
> >> > Answers include "mock out datetime.datetime" and "make the original code
> >> > get
> >> > the time via another method that can be mocked out or via a default
> >> > argument
> >> > def foo(now=datetime.datetime.now) which can be overridden".
>
> >> > --dave
>
> >> > On Jun 14, 2009 7:49 PM, "Vbabiy" <
vbabi...@gmail.com> wrote:
>
> >> > How I am trying to mock out the datetime.now method, but I can't seem
> >> > to do it right. Can someone give me an example.
>
> >> > Thanks
>
> >> --
> >> Steve Middlekauff