Fake utcnow for the pytestUnit Testing of parser method using pytestTrying to use global variables for referencing directories in Python 2.5TDD - Kata - String CalculatorMocking UserDefaults in SwiftPython - Faster random business date generationHours and Minutes math in a work week calculatorApply a series of functions on Django querysets using decoratorsCode to implement the Jaro similarity for fuzzy matching stringsMaking a graph of the import structure of a programCurrency converter - CLI and API

Formatting a table to look nice

Difference between 'stomach' and 'uterus'

I can't die. Who am I?

Ahoy, Ye Traveler!

Is there a full canon version of Tyrion's jackass/honeycomb joke?

Why do phishing e-mails use faked e-mail addresses instead of the real one?

Is there any relevance to Thor getting his hair cut other than comedic value?

It doesn't matter the side you see it

Should we avoid writing fiction about historical events without extensive research?

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

When to use mean vs median

Is divide-by-zero a security vulnerability?

Canadian citizen, on US no-fly list. What can I do in order to be allowed on flights which go through US airspace?

How can neutral atoms have exactly zero electric field when there is a difference in the positions of the charges?

PTIJ: Why can't I sing about soda on certain days?

is 'sed' thread safe

Specific Chinese carabiner QA?

Can a Trickery Domain cleric cast a spell through the Invoke Duplicity clone while inside a Forcecage?

Are there other characters in the Star Wars universe who had damaged bodies and needed to wear an outfit like Darth Vader?

School performs periodic password audits. Is my password compromised?

Misplaced tyre lever - alternatives?

How can I handle a player who pre-plans arguments about my rulings on RAW?

How to mitigate "bandwagon attacking" from players?

“I had a flat in the centre of town, but I didn’t like living there, so …”



Fake utcnow for the pytest


Unit Testing of parser method using pytestTrying to use global variables for referencing directories in Python 2.5TDD - Kata - String CalculatorMocking UserDefaults in SwiftPython - Faster random business date generationHours and Minutes math in a work week calculatorApply a series of functions on Django querysets using decoratorsCode to implement the Jaro similarity for fuzzy matching stringsMaking a graph of the import structure of a programCurrency converter - CLI and API













4












$begingroup$


I want to create a pytest with a fake utcnow, but also I need to preserve the functionality of all other datetime methods. Simple example here:



import datetime as dt


class FakeTime(dt.datetime):
fake_time = None

@classmethod
def utcnow(cls):
return cls.fake_time


def str_2_time(str_dt: str) -> dt.datetime:
"""Shortcut to do convert the string to datetime"""
return dt.datetime.strptime(str_dt, '%Y-%m-%d %H:%M')


def test_patch_datetime():
for utc_time in ['2019-01-01 10:00', '2019-02-01 13:00', '2019-03-01 16:00']:
FakeTime.fake_time = str_2_time(utc_time)
dt.datetime = FakeTime
assert dt.datetime.utcnow() == str_2_time(utc_time)


Is this the right way?



The method str_2_time just need to show that all other methods of the datetime works fine.










share|improve this question









New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
    $endgroup$
    – Anentropic
    15 hours ago










  • $begingroup$
    @Anentropic thank you, but if i will need more options i will add the package to the project
    $endgroup$
    – Bear Brown
    14 hours ago















4












$begingroup$


I want to create a pytest with a fake utcnow, but also I need to preserve the functionality of all other datetime methods. Simple example here:



import datetime as dt


class FakeTime(dt.datetime):
fake_time = None

@classmethod
def utcnow(cls):
return cls.fake_time


def str_2_time(str_dt: str) -> dt.datetime:
"""Shortcut to do convert the string to datetime"""
return dt.datetime.strptime(str_dt, '%Y-%m-%d %H:%M')


def test_patch_datetime():
for utc_time in ['2019-01-01 10:00', '2019-02-01 13:00', '2019-03-01 16:00']:
FakeTime.fake_time = str_2_time(utc_time)
dt.datetime = FakeTime
assert dt.datetime.utcnow() == str_2_time(utc_time)


Is this the right way?



The method str_2_time just need to show that all other methods of the datetime works fine.










share|improve this question









New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$











  • $begingroup$
    I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
    $endgroup$
    – Anentropic
    15 hours ago










  • $begingroup$
    @Anentropic thank you, but if i will need more options i will add the package to the project
    $endgroup$
    – Bear Brown
    14 hours ago













4












4








4





$begingroup$


I want to create a pytest with a fake utcnow, but also I need to preserve the functionality of all other datetime methods. Simple example here:



import datetime as dt


class FakeTime(dt.datetime):
fake_time = None

@classmethod
def utcnow(cls):
return cls.fake_time


def str_2_time(str_dt: str) -> dt.datetime:
"""Shortcut to do convert the string to datetime"""
return dt.datetime.strptime(str_dt, '%Y-%m-%d %H:%M')


def test_patch_datetime():
for utc_time in ['2019-01-01 10:00', '2019-02-01 13:00', '2019-03-01 16:00']:
FakeTime.fake_time = str_2_time(utc_time)
dt.datetime = FakeTime
assert dt.datetime.utcnow() == str_2_time(utc_time)


Is this the right way?



The method str_2_time just need to show that all other methods of the datetime works fine.










share|improve this question









New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.







$endgroup$




I want to create a pytest with a fake utcnow, but also I need to preserve the functionality of all other datetime methods. Simple example here:



import datetime as dt


class FakeTime(dt.datetime):
fake_time = None

@classmethod
def utcnow(cls):
return cls.fake_time


def str_2_time(str_dt: str) -> dt.datetime:
"""Shortcut to do convert the string to datetime"""
return dt.datetime.strptime(str_dt, '%Y-%m-%d %H:%M')


def test_patch_datetime():
for utc_time in ['2019-01-01 10:00', '2019-02-01 13:00', '2019-03-01 16:00']:
FakeTime.fake_time = str_2_time(utc_time)
dt.datetime = FakeTime
assert dt.datetime.utcnow() == str_2_time(utc_time)


Is this the right way?



The method str_2_time just need to show that all other methods of the datetime works fine.







python datetime unit-testing mocks






share|improve this question









New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 17 hours ago







Bear Brown













New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 21 hours ago









Bear BrownBear Brown

1236




1236




New contributor




Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Bear Brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • $begingroup$
    I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
    $endgroup$
    – Anentropic
    15 hours ago










  • $begingroup$
    @Anentropic thank you, but if i will need more options i will add the package to the project
    $endgroup$
    – Bear Brown
    14 hours ago
















  • $begingroup$
    I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
    $endgroup$
    – Anentropic
    15 hours ago










  • $begingroup$
    @Anentropic thank you, but if i will need more options i will add the package to the project
    $endgroup$
    – Bear Brown
    14 hours ago















$begingroup$
I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
$endgroup$
– Anentropic
15 hours ago




$begingroup$
I highly recommend this lib for mocking now in python tests github.com/spulec/freezegun
$endgroup$
– Anentropic
15 hours ago












$begingroup$
@Anentropic thank you, but if i will need more options i will add the package to the project
$endgroup$
– Bear Brown
14 hours ago




$begingroup$
@Anentropic thank you, but if i will need more options i will add the package to the project
$endgroup$
– Bear Brown
14 hours ago










2 Answers
2






active

oldest

votes


















6












$begingroup$

According to this, subclassing datetime.datetime seems the way to go.



There is no use for the str_2_time method though. You can easily inline this, or even simpler, just use the datetime.datetime constructor:



def test_patch_datetime():
for utc_time in [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time


You should be aware that this can have side effects in other parts of your code, so it might be needed to replace it back with the original class after the test method:



def test_patch_datetime():
datetime_orig = dt.datetime

utc_times = [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]
for utc_time in utc_times:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time
dt.datetime = datetime_orig
# print(dt.datetime.utcnow())
assert dt.datetime.utcnow() > max(utc_times)





share|improve this answer











$endgroup$












  • $begingroup$
    thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
    $endgroup$
    – Bear Brown
    20 hours ago


















2












$begingroup$

Usually, I do:



  1. Separate module, for example utils.py, that contains:

from datetime import datetime

def get_utcnow() -> datetime:
return datetime.utcnow()


  1. Use this function everywhere in my code.

  2. Add the mocking fixture in tests/conftest.py:

from datetime import datetime, timedelta

import pytest

from .. import utils

@pytest.fixture
def mock_utcnow(monkeypatch):
now = datetime.min

def wrapped(delta=0.0):
when = now + timedelta(delta)
monkeypatch.setattr(utils, "get_utcnow", lambda: when)
return when

return wrapped


  1. Now it's easy to use it in your tests:

def test(mock_utcnow):
now = mock_utcnow()
new_now = mock_utcnow(0.1)


Additionally, with this fixture you can set the returning value with desired offset.



Hope it helps.






share|improve this answer








New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$












  • $begingroup$
    thank you for the answer, but i don't understand how it should help for my case.
    $endgroup$
    – Bear Brown
    14 hours ago










Your Answer





StackExchange.ifUsing("editor", function ()
return StackExchange.using("mathjaxEditing", function ()
StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
);
);
, "mathjax-editing");

StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "196"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);






Bear Brown is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f214816%2ffake-utcnow-for-the-pytest%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









6












$begingroup$

According to this, subclassing datetime.datetime seems the way to go.



There is no use for the str_2_time method though. You can easily inline this, or even simpler, just use the datetime.datetime constructor:



def test_patch_datetime():
for utc_time in [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time


You should be aware that this can have side effects in other parts of your code, so it might be needed to replace it back with the original class after the test method:



def test_patch_datetime():
datetime_orig = dt.datetime

utc_times = [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]
for utc_time in utc_times:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time
dt.datetime = datetime_orig
# print(dt.datetime.utcnow())
assert dt.datetime.utcnow() > max(utc_times)





share|improve this answer











$endgroup$












  • $begingroup$
    thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
    $endgroup$
    – Bear Brown
    20 hours ago















6












$begingroup$

According to this, subclassing datetime.datetime seems the way to go.



There is no use for the str_2_time method though. You can easily inline this, or even simpler, just use the datetime.datetime constructor:



def test_patch_datetime():
for utc_time in [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time


You should be aware that this can have side effects in other parts of your code, so it might be needed to replace it back with the original class after the test method:



def test_patch_datetime():
datetime_orig = dt.datetime

utc_times = [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]
for utc_time in utc_times:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time
dt.datetime = datetime_orig
# print(dt.datetime.utcnow())
assert dt.datetime.utcnow() > max(utc_times)





share|improve this answer











$endgroup$












  • $begingroup$
    thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
    $endgroup$
    – Bear Brown
    20 hours ago













6












6








6





$begingroup$

According to this, subclassing datetime.datetime seems the way to go.



There is no use for the str_2_time method though. You can easily inline this, or even simpler, just use the datetime.datetime constructor:



def test_patch_datetime():
for utc_time in [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time


You should be aware that this can have side effects in other parts of your code, so it might be needed to replace it back with the original class after the test method:



def test_patch_datetime():
datetime_orig = dt.datetime

utc_times = [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]
for utc_time in utc_times:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time
dt.datetime = datetime_orig
# print(dt.datetime.utcnow())
assert dt.datetime.utcnow() > max(utc_times)





share|improve this answer











$endgroup$



According to this, subclassing datetime.datetime seems the way to go.



There is no use for the str_2_time method though. You can easily inline this, or even simpler, just use the datetime.datetime constructor:



def test_patch_datetime():
for utc_time in [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time


You should be aware that this can have side effects in other parts of your code, so it might be needed to replace it back with the original class after the test method:



def test_patch_datetime():
datetime_orig = dt.datetime

utc_times = [
dt.datetime(2019, 1, 1, 10),
dt.datetime(2019, 2, 1, 13),
dt.datetime(2019, 3, 1, 16),
]
for utc_time in utc_times:
FakeTime.fake_time = utc_time
dt.datetime = FakeTime
assert dt.datetime.utcnow() == utc_time
dt.datetime = datetime_orig
# print(dt.datetime.utcnow())
assert dt.datetime.utcnow() > max(utc_times)






share|improve this answer














share|improve this answer



share|improve this answer








edited 20 hours ago

























answered 21 hours ago









Maarten FabréMaarten Fabré

5,019417




5,019417











  • $begingroup$
    thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
    $endgroup$
    – Bear Brown
    20 hours ago
















  • $begingroup$
    thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
    $endgroup$
    – Bear Brown
    20 hours ago















$begingroup$
thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
$endgroup$
– Bear Brown
20 hours ago




$begingroup$
thank you, but the method str_2_time just need to show that all other methods of the datetime works fine.
$endgroup$
– Bear Brown
20 hours ago













2












$begingroup$

Usually, I do:



  1. Separate module, for example utils.py, that contains:

from datetime import datetime

def get_utcnow() -> datetime:
return datetime.utcnow()


  1. Use this function everywhere in my code.

  2. Add the mocking fixture in tests/conftest.py:

from datetime import datetime, timedelta

import pytest

from .. import utils

@pytest.fixture
def mock_utcnow(monkeypatch):
now = datetime.min

def wrapped(delta=0.0):
when = now + timedelta(delta)
monkeypatch.setattr(utils, "get_utcnow", lambda: when)
return when

return wrapped


  1. Now it's easy to use it in your tests:

def test(mock_utcnow):
now = mock_utcnow()
new_now = mock_utcnow(0.1)


Additionally, with this fixture you can set the returning value with desired offset.



Hope it helps.






share|improve this answer








New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$












  • $begingroup$
    thank you for the answer, but i don't understand how it should help for my case.
    $endgroup$
    – Bear Brown
    14 hours ago















2












$begingroup$

Usually, I do:



  1. Separate module, for example utils.py, that contains:

from datetime import datetime

def get_utcnow() -> datetime:
return datetime.utcnow()


  1. Use this function everywhere in my code.

  2. Add the mocking fixture in tests/conftest.py:

from datetime import datetime, timedelta

import pytest

from .. import utils

@pytest.fixture
def mock_utcnow(monkeypatch):
now = datetime.min

def wrapped(delta=0.0):
when = now + timedelta(delta)
monkeypatch.setattr(utils, "get_utcnow", lambda: when)
return when

return wrapped


  1. Now it's easy to use it in your tests:

def test(mock_utcnow):
now = mock_utcnow()
new_now = mock_utcnow(0.1)


Additionally, with this fixture you can set the returning value with desired offset.



Hope it helps.






share|improve this answer








New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$












  • $begingroup$
    thank you for the answer, but i don't understand how it should help for my case.
    $endgroup$
    – Bear Brown
    14 hours ago













2












2








2





$begingroup$

Usually, I do:



  1. Separate module, for example utils.py, that contains:

from datetime import datetime

def get_utcnow() -> datetime:
return datetime.utcnow()


  1. Use this function everywhere in my code.

  2. Add the mocking fixture in tests/conftest.py:

from datetime import datetime, timedelta

import pytest

from .. import utils

@pytest.fixture
def mock_utcnow(monkeypatch):
now = datetime.min

def wrapped(delta=0.0):
when = now + timedelta(delta)
monkeypatch.setattr(utils, "get_utcnow", lambda: when)
return when

return wrapped


  1. Now it's easy to use it in your tests:

def test(mock_utcnow):
now = mock_utcnow()
new_now = mock_utcnow(0.1)


Additionally, with this fixture you can set the returning value with desired offset.



Hope it helps.






share|improve this answer








New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






$endgroup$



Usually, I do:



  1. Separate module, for example utils.py, that contains:

from datetime import datetime

def get_utcnow() -> datetime:
return datetime.utcnow()


  1. Use this function everywhere in my code.

  2. Add the mocking fixture in tests/conftest.py:

from datetime import datetime, timedelta

import pytest

from .. import utils

@pytest.fixture
def mock_utcnow(monkeypatch):
now = datetime.min

def wrapped(delta=0.0):
when = now + timedelta(delta)
monkeypatch.setattr(utils, "get_utcnow", lambda: when)
return when

return wrapped


  1. Now it's easy to use it in your tests:

def test(mock_utcnow):
now = mock_utcnow()
new_now = mock_utcnow(0.1)


Additionally, with this fixture you can set the returning value with desired offset.



Hope it helps.







share|improve this answer








New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered 15 hours ago









S. ZobovS. Zobov

212




212




New contributor




S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






S. Zobov is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • $begingroup$
    thank you for the answer, but i don't understand how it should help for my case.
    $endgroup$
    – Bear Brown
    14 hours ago
















  • $begingroup$
    thank you for the answer, but i don't understand how it should help for my case.
    $endgroup$
    – Bear Brown
    14 hours ago















$begingroup$
thank you for the answer, but i don't understand how it should help for my case.
$endgroup$
– Bear Brown
14 hours ago




$begingroup$
thank you for the answer, but i don't understand how it should help for my case.
$endgroup$
– Bear Brown
14 hours ago










Bear Brown is a new contributor. Be nice, and check out our Code of Conduct.









draft saved

draft discarded


















Bear Brown is a new contributor. Be nice, and check out our Code of Conduct.












Bear Brown is a new contributor. Be nice, and check out our Code of Conduct.











Bear Brown is a new contributor. Be nice, and check out our Code of Conduct.














Thanks for contributing an answer to Code Review Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

Use MathJax to format equations. MathJax reference.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcodereview.stackexchange.com%2fquestions%2f214816%2ffake-utcnow-for-the-pytest%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Can't initialize raids on a new ASUS Prime B360M-A motherboard2019 Community Moderator ElectionSimilar to RAID config yet more like mirroring solution?Can't get motherboard serial numberWhy does the BIOS entry point start with a WBINVD instruction?UEFI performance Asus Maximus V Extreme

Identity Server 4 is not redirecting to Angular app after login2019 Community Moderator ElectionIdentity Server 4 and dockerIdentityserver implicit flow unauthorized_clientIdentityServer Hybrid Flow - Access Token is null after user successful loginIdentity Server to MVC client : Page Redirect After loginLogin with Steam OpenId(oidc-client-js)Identity Server 4+.NET Core 2.0 + IdentityIdentityServer4 post-login redirect not working in Edge browserCall to IdentityServer4 generates System.NullReferenceException: Object reference not set to an instance of an objectIdentityServer4 without HTTPS not workingHow to get Authorization code from identity server without login form

2005 Ahvaz unrest Contents Background Causes Casualties Aftermath See also References Navigation menue"At Least 10 Are Killed by Bombs in Iran""Iran"Archived"Arab-Iranians in Iran to make April 15 'Day of Fury'"State of Mind, State of Order: Reactions to Ethnic Unrest in the Islamic Republic of Iran.10.1111/j.1754-9469.2008.00028.x"Iran hangs Arab separatists"Iran Overview from ArchivedConstitution of the Islamic Republic of Iran"Tehran puzzled by forged 'riots' letter""Iran and its minorities: Down in the second class""Iran: Handling Of Ahvaz Unrest Could End With Televised Confessions""Bombings Rock Iran Ahead of Election""Five die in Iran ethnic clashes""Iran: Need for restraint as anniversary of unrest in Khuzestan approaches"Archived"Iranian Sunni protesters killed in clashes with security forces"Archived